<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>测试jquery的使用</title>
</head>
<body>
<button id="btn" onclick="clickBtn()">按钮1</button>
</body>
<script src="jquery-1.12.4.min.js"></script>
<script>
$(function () {
// alert("jquery...")
function clickBtn(){
console.error('按钮1')
}
});
</script>
</html>
实际方式如下,分为两种:
<script>