<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>jquery基础语法</title>
<script type="text/javascript" src="jquery-3.3.1.min.js"></script>
<style type="text/css">
div{width:200px;height:200px;border:1px solid red;}
</style>
</head>
<body>
<div></div>
<button class="hide">隐藏</button><button class="show">显示</button><button class="BgColor">换色</button>
<script>
$(document).ready(function(){
$mStr="jquery的字符串变量";
console.log($mStr);
$('.hide').click(function(){
$('div').hide();
})
$('.show').click(function(){
$('div').show();
})
$('.BgColor').click(function(){
$('div').css('background-color','red');
})
})
</script>
</body>
</html>