案例:jQuery案例     状态:可编辑再运行    进入竖版
 运行结果 
x
 
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<script src="/js/jquery.js"></script>
5
<script>
6
$(document).ready(function(){
7
  $("button").click(function(){
8
    $("p").unwrap();
9
  });
10
});
11
</script>
12
<style type="text/css">
13
div{background-color:yellow;}
14
article{background-color:pink;}
15
</style>
16
</head>
17
<body>
18
19
<div>
20
<p>这是 div 元素中的段落。</p>
21
</div>
22
23
<article>
24
<p>这是 article 元素中的段落。</p>
25
</article>
26
27
<button>删除每个 p 元素的父元素</button>
28
29
</body>
30
</html>
31