案例: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
  $("#btn1").click(function(){
8
    $("p").prepend("<b>Prepended text</b>. ");
9
  });
10
  $("#btn2").click(function(){
11
    $("ol").prepend("<li>Prepended item</li>");
12
  });
13
});
14
</script>
15
</head>
16
<body>
17
18
<p>This is a paragraph.</p>
19
<p>This is another paragraph.</p>
20
<ol>
21
<li>List item 1</li>
22
<li>List item 2</li>
23
<li>List item 3</li>
24
</ol>
25
26
<button id="btn1">添加文本</button>
27
<button id="btn2">添加列表项</button>
28
29
</body>
30
</html>
31