案例:jquery案例     状态:可编辑再运行    进入竖版
 运行结果 
x
 
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<script src="/js/jquery-1.11.1.min.js"></script>
5
<script>
6
$(document).ready(function(){
7
  $("button").click(function(){
8
    $("#div1").empty();
9
  });
10
});
11
</script>
12
</head>
13
14
<body>
15
16
<div id="div1" style="height:100px;width:300px;border:1px solid black;background-color:yellow;">
17
This is some text in the div.
18
<p>This is a paragraph in the div.</p>
19
<p>This is another paragraph in the div.</p>
20
</div>
21
22
<br>
23
<button>清空 div 元素</button>
24
25
</body>
26
</html>
27