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>
例:查询偶数个表格的行。
<!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>
相关文章推荐
- JQUERY1.9学习笔记 之基本过滤器(十一) 奇数选择器
- JQUERY1.9学习笔记 之基本过滤器(一) 动态选择器
- 前端学习笔记-jquery-11-(过滤选择器)过滤器:可见性过滤器
- ASP.NET MVC5 学习笔记-1 控制器、路由、返回类型、选择器、过滤器
- The Definitive Guide To Django 2 学习笔记(八) 第四章 模板 (四)基本的模板标签和过滤器
- CSS3学习笔记 之 基本选择器
- JQuery学习笔记-基本过滤选择器
- JavaScript学习笔记8-jQuery基本过滤选择器深度解析
- 前端学习笔记-jquery-12-(过滤选择器)过滤器:子元素过滤器
- JQUERY1.9学习笔记 之基本过滤器(十二) 根元素选择器
- JQuery学习笔记-基本选择器
- JQUERY1.9学习笔记 之内容过滤器(三) has选择器
- JQuery学习笔记-基本选择器
- JavaScript学习笔记8-jQuery基本选择器深度解析
- JQuery学习笔记-基本过滤选择器
- JQUERY1.9学习笔记 之基本过滤器(四) 首元素选择器
- jquery1.9学习笔记 之选择器(基本元素二)
- 前端学习笔记-jquery-10-(过滤选择器)过滤器:内容过滤器
- jQuery学习笔录2(jQuery学习笔记——选择器(2)&过滤器)
- 前端学习笔记-jquery-5-基本选择器