案例:jquery案例     状态:可编辑再运行    进入竖版
 运行结果 
x
 
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<script src="/js/jquery-1.11.1.min.js">
5
</script>
6
<script>
7
$(document).ready(function(){
8
  $("button").click(function(){
9
    $("h1,h2,p").toggleClass("blue");
10
  });
11
});
12
</script>
13
<style type="text/css">
14
.blue
15
{
16
color:blue;
17
}
18
</style>
19
</head>
20
<body>
21
22
<h1>标题 1</h1>
23
<h2>标题 2</h2>
24
<p>这是一个段落。</p>
25
<p>这是另一个段落。</p>
26
<button>切换 CSS 类</button>
27
</body>
28
</html>
29