您的位置:首页 > Web前端 > JQuery

JQUERY1.9学习笔记 之基本过滤器(三)偶数选择器

2014-01-14 17:15 344 查看
偶数选择器 jQuery( ":even" )

例:查询偶数个表格的行。

<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="utf-8">
<title>even demo</title>
<style>
table{
background:#eee;
}
</style>
<script src="js/jquery-1.9.1.min.js"></script>
</head>
<body>
<table border="1">
<tr><td>Row with Index #0</td></tr>
<tr><td>Row with Index #1</td></tr>
<tr><td>Row with Index #2</td></tr>
<tr><td>Row with Index #3</td></tr>
</table>
<script>
$("tr:even").css("background-color","#bbf");
</script>
</body>
</html>

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: