案例:jQuery案例     状态:可编辑再运行    进入竖版
 运行结果 
x
 
1
<!DOCTYPE html>
2
<html>
3
<head>
4
  <style>
5
  div { width:60px; height:60px; margin:10px; float:left;
6
        border:2px solid blue; }
7
  .blue { background:blue; }
8
  </style>
9
  <script type="text/javascript" src="/js/jquery.js"></script>
10
</head>
11
12
<body>
13
  <div></div>
14
  <div></div>
15
  <div></div>
16
17
  <div></div>
18
  <div></div>
19
  <div></div>
20
21
  <script>$("body").find("div").eq(2).addClass("blue");</script>
22
</body>
23
</html>
24