| 范文 | 这篇文章主要介绍了jquery使用hide方法隐藏指定id的元素,实例分析了jQuery中hide隐藏指定id元素的技巧,具有一定参考借鉴价值,需要的朋友可以参考下
 本文实例讲述了jquery使用hide方法隐藏指定id的元素。分享给大家供大家参考。具体如下:
 下面的代码通过jQuery的hide方法隐藏了id=test的元素
 <!DOCTYPE html>
 <html>
 <head>
 <script src="js/jquery.min.js">
 </script>
 <script>
 $(document).ready(function(){
 $("button").click(function(){
 $("#test").hide();
 });
 });
 </script>
 </head>
 <body>
 <h2>This is a heading</h2>
 <p>This is a paragraph.</p>
 <p id="test">This is another paragraph.jb51.net</p>
 <button>Click me</button>
 </body>
 </html>
 希望本文所述对大家的jQuery程序设计有所帮助。
 |