案例: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
    $("p").slideToggle();
8
  });
9
  $("p").dblclick(function(){
10
    $("button").click();
11
  });
12
});
13
</script>
14
</head>
15
<body>
16
<button>点击这里进行切换</button>
17
<p>双击本段落会触发上面这个按钮的 click 事件。</p>
18
</body>
19
</html>
20