get()

get() 方法获得由选择器指定的 DOM 元素。

 1 <p>This is a paragraph</p> 

1 <script type="text/javascript">
2 $(document).ready(function(){
3   $("button").click(function(){
4     x=$("p").get(0);
5     $("div").text(x.nodeName + ": " + x.innerHTML);
6   });
7 });
8 </script>

 1 $(selector).get(index) 

posted @ 2015-02-03 14:00  JJ.Net  阅读(240)  评论(2)    收藏  举报