jQuery使用hide方法隐藏页面上指定元素的方法
本文实例讲述了jQuery使用hide方法隐藏页面上指定元素的方法。分享给大家供大家参考。具体如下:
下面的JS代码隐藏了网页中所有<p>标签的内容
<!DOCTYPEhtml>
<html>
<head>
<scriptsrc="js/jquery.min.js">
</script>
<script>
$(document).ready(function(){
$("button").click(function(){
$("p").hide();
});
});
</script>
</head>
<body>
<h2>Thisisaheading</h2>
<p>Thisisaparagraph.</p>
<p>Thisisanotherparagraph.</p>
<button>Clickme</button>
</body>
</html>
希望本文所述对大家的jQuery程序设计有所帮助。
热门推荐
10 简短大气的狗年祝福语
11 许嵩生日祝福语简短
12 38节贺卡简短祝福语
13 简短的出行工作祝福语
14 诗词文案祝福语简短精辟
15 中考祝福语简短卡片大全
16 给老师祝福语简短创意
17 喜事敬酒祝福语简短精辟
18 祝老婆生日祝福语简短