jQuery DOM 元素方法 - get() 方法

编辑器加载中...

 1 <html>
2 <head>
3 <!--get() 方法获得由选择器指定的 DOM 元素。-->
4 <script type = "text/javascript" src = "jquery.js"></script>
5 <script type = "text/javascript">
6 $(document).ready(function(){
7 $("button").click(function(){
8 x = $("p").get();
9 for(var i = 0;i<x.length;i++){
10 document.write(x[i].innerHTML+"/");
11 }
12 alert(x)
13 });
14 });
15 </script>
16 </head>
17 <body>
18 <p>this</p>
19 <p>this</p>
20 <p>this</p>
21 <p>this</p>
22 <p>this</p>
23 <p>this</p>
24 <button type = "button">click</button>
25 </body>
posted @ 2012-02-21 14:26  lcyang  阅读(210)  评论(0编辑  收藏  举报