jquery子元素过滤选择器
:nth-child('索引值')//获取指定元素下的某个子元素的位置,索引从1开始;
//偶数行
//$('li:nth-child(even)').addClass('class1');
//奇数行
//$('li:nth-child(odd)').addClass('class1');
//第一行
//$('li:nth-child(1)').addClass('class1');
//$('li:first-child').addClass('class1');
//只有1个子元素
$('li:only-child').addClass('class1');
jquery子元素过滤选择器的更多相关文章
- jQuery内容过滤选择器与子元素过滤选择器用法实例分析
jQuery选择器内容过滤 一.:contains(text) 选择器::contains(text)描述:匹配包含给定文本的元素返回值:元素集合 示例: ? 1 2 $("div.mini ...
- jQuery选择器之子元素过滤选择器Demo
测试代码: 07-子元素过滤选择器.html <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" & ...
- 过滤选择器first与子元素过滤选择器first-child的区别
1.表格代码如下: <table id="table"> <tr> <td>id</td> <td>name</t ...
- jquery 子元素筛选选择器
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-type" content ...
- jQuery选择器(子元素过滤选择器)第七节
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/stri ...
- 008 jquery过滤选择器-----------(子元素过滤选择器)
1.介紹 2.程序 <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> < ...
- jQuery中的子(后代)元素过滤选择器(四、六):nth-child()、first-child、last-child、only-child
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <hea ...
- jQuery学习之过滤选择器
基本过滤选择器 :first 选取第一个元素:$("div:first") :last 选取最后一个元素:$("div:last") :not(selector ...
- Jquery | 基础 | 使用 jQuery 表单过滤选择器
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
随机推荐
- IT第四天 - 运算符、随机数、Math类
IT第四天 上午 运算符 1.%运算符的应用 2.运算符优先级:小括号 ! 算数运算符 关系运算符 && || 赋值运算符 3.三元运算符:?表示条件为true的结果,:表示条件为 ...
- LA-3135 - Argus(优先队列)
3135 - Argus A data stream is a real-time, continuous, ordered sequence of items. Some examples incl ...
- STL 源代码剖析 算法 stl_algo.h -- partition
本文为senlie原创,转载请保留此地址:http://blog.csdn.net/zhengsenlie partition ------------------------------------ ...
- HDU 1862 EXCEL次序 (排序水问题)
Problem Description Excel对能够记录一组由任意列排序指定.现在,请把你编译的代码类似特征. Input 測试输入包括若干測试用例. 每一个測试用例的第1行包括两个整数 N ...
- 使用client对象模型回写SharePoint列表
使用client对象模型回写SharePoint列表 client对象模型是一个有效的方式回写SharePoint列表. 1. 管理员身份打开VS,新建WPF应用程序SPWriteListApp,确保 ...
- 【Eclipse】修改项目访问名称
Properties --> Web Project Settings --> Context root --> 输入想要用的名称(默认是项目名)
- android:music
package com.terry; import java.io.File; import java.io.FileFilter; import java.io.IOException; impor ...
- Oauth1.0认证过程
现今,已经有了Oauth2.0,写篇博客了解Oauth1.0的过程以及与2.0的区别. 在Oauth官网 关于1.0的介绍: 一.简介 OAuth authentication is the pro ...
- POJ 3675 Telescope 简单多边形和圆的面积交
这道题得控制好精度,不然会贡献WA QAQ 还是那个规则: int sgn(double x){ if(x > eps) return 1; else if(x < - eps) ret ...
- atlas z 轴
问题源自一个帖子,因为上传的图比较多,就另开了这个贴写下自己的试验结果,原帖在下面链接中 http://game.ceeger.com/forum/read.php?tid=8911#info NGU ...