jQuery的基础语法
至诚网络2019-04-10 15:56:14246<!DOCTYPE html>
<html>
<head>
<title>jQuery的基础语法</title>
<link rel="stylesheet" type="text/css" href="">
<script type="text/javascript" src="../jQuery/jquery-3.3.1.min.js"></script>
</head>
<body>
<script type="text/javascript">
// 放入javaScript代码或者jQuery代码
// 文档就绪函数
// 基本格式
// $(document).ready(function(){
// jQuery代码
// })
// $(选择器).action()
$(document).ready(function(){
// $str='我是一个声明变量'
// alert($str);
$('div').hide()
$('button').click(function(){
$('div').show()
})
})
</script>
<div style="width:100px;height:100px;background:pink;"></div>
<button>点击</button>
</body>
</html>