jquery基础语法

原创 2019-04-05 08:10:35 312
摘要:<!DOCTYPE html><html><head>    <meta charset="utf-8"> <title>jquery基础语法</title> <script type="text/javascript" src="static/jqu

<!DOCTYPE html>

<html>

<head>

    <meta charset="utf-8">

<title>jquery基础语法</title>

<script type="text/javascript" src="static/jquery-3.3.1.min.js"></script>

</head>

<body>

<div style="width:100px;height:100px;background:green;"></div>

<button id="btn1">显示</button>  <button id="btn2">隐藏</button>

<script type="text/javascript">


$(document).ready(function(){

       

$("#btn2").click(function(){

$("div").hide()//隐藏DIV

})

$("#btn1").click(function() {

$("div").show()//点击按钮显示DIV

})



})

</script>



</body>

</html>


批改老师:天蓬老师批改时间:2019-04-08 09:21:44
老师总结:jquery 的语法的精华就是选择器与操作, 他的链式操作是特点

发布手记

热门词条