```
<html>
<head>
<meta charset="UTF-8">
<title>基本过滤器</title>
<style type="text/css">
</style>
<script type="text/javascript" src="../tool/jquery-1.11.0.min.js"></script>
<script type="text/javascript">
$(document).ready(
function () {
$("h2").click(
function () {
//改变第一个<li>元素的背景色
//$("li:first").css("background-color", "#09F");
//改变所有标题元素的背景色,如改变<h1>,<h2>,<h3>....元素的背景色
//$(":header").css("background-color", "#09F");
}
);
//改变最后一個<li>元素的背景色
//$("li:last").css("background-color", "#09F");
//改变class不为three的<li>元素的背景颜色
//$("li:not(.three)").css("background-color", "#09F");
//改变索引值为偶数的<li>元素的背景颜色
//$("li:even").css("background-color", "#09F");
//改变索引值为奇数的<li>元素的背景颜色
//$("li:odd").css("background-color", "#09F");
//改变索引值为1的<li>元素的背景色
//$("li:eq(1)").css("background-color", "#09F");
//改变索引值大于1的<li>元素的背景色
//$("li:gt(1)").css("background-color", "#09F");
//改变索引值小于1的<li>元素的背景色
//$("li:lt(1)").css("background-color", "#09F");
//改变当前获取焦点的元素的背景色
$(":focus").css("background-color", "#09F");
}
);
</script>
</head>
<body>
<h2>网络小说</h2>
<ul>
<li>小说1</li>
<li>小说2</li>
<li class="three">小说3</li>
<li>小说4</li>
<li>小说5</li>
<li>小说6</li>
<li>小说7</li>
<li>小说8</li>
</ul>
</body>
</html>
```