jQuery的基础语法
L2019-05-10 08:58:45228<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>jquery的基础语法</title>
<script type="text/javascript" src="static/jquery-3.3.1.min.js"></script>
<style type="text/css">
.box{
width: 200px;
height: 200px;
box-shadow: 5px 5px 2px #888888;
border: 1px solid red;
margin: 30px 60px;
}
.btn{width: 80px;height: 30px;text-align: center;line-height: 20px;}
</style>
</head>
<body>
<button class="btn">点击</button>
<div class="box"></div>
<script type="text/javascript">
$(function(){
$('.box').hide();
$('.btn').click(function(){
$('.box').show();
})
$('.btn').dblclick(function(){
$('.box').hide();
})
})
</script>
</body>
</html>