案例:jQuery案例     状态:可编辑再运行    进入竖版
 运行结果 
x
 
1
<html>
2
<head>
3
<script type="text/javascript" src="/js/jquery.js"></script>
4
<script type="text/javascript">
5
$(document).ready(function(){
6
  $("button").click(function(){
7
    x=$("p").get(0);
8
    $("div").text(x.nodeName + ": " + x.innerHTML);
9
  });
10
});
11
</script>
12
</head>
13
<body>
14
<p>This is a paragraph</p>
15
<button>获得 p DOM 元素</button>
16
<div></div>
17
</body>
18
</html>
19