案例:jQuery案例     状态:可编辑再运行    进入竖版
 运行结果 
x
 
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<script type="text/javascript" src="/js/jquery.js"></script>
5
<style>
6
  p, div { margin:5px; padding:5px; }
7
  .border { border: 2px solid red; }
8
  .background { background:yellow; }
9
</style>
10
</head>
11
<body>
12
<ul>
13
   <li>list item 1</li>
14
   <li>list item 2</li>
15
   <li class="third-item">list item 3</li>
16
   <li>list item 4</li>
17
   <li>list item 5</li>
18
</ul>
19
<script>
20
$("li.third-item").nextAll().andSelf().css("background-color", "red");
21
</script>
22
</body>
23
</html>
24