: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子元素过滤选择器的更多相关文章

  1. jQuery内容过滤选择器与子元素过滤选择器用法实例分析

    jQuery选择器内容过滤 一.:contains(text) 选择器::contains(text)描述:匹配包含给定文本的元素返回值:元素集合 示例: ? 1 2 $("div.mini ...

  2. jQuery选择器之子元素过滤选择器Demo

    测试代码: 07-子元素过滤选择器.html <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" & ...

  3. 过滤选择器first与子元素过滤选择器first-child的区别

    1.表格代码如下: <table id="table"> <tr> <td>id</td> <td>name</t ...

  4. jquery 子元素筛选选择器

    <!DOCTYPE html> <html> <head> <meta http-equiv="Content-type" content ...

  5. jQuery选择器(子元素过滤选择器)第七节

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/stri ...

  6. 008 jquery过滤选择器-----------(子元素过滤选择器)

    1.介紹 2.程序 <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> < ...

  7. jQuery中的子(后代)元素过滤选择器(四、六):nth-child()、first-child、last-child、only-child

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <hea ...

  8. jQuery学习之过滤选择器

    基本过滤选择器 :first 选取第一个元素:$("div:first") :last 选取最后一个元素:$("div:last") :not(selector ...

  9. Jquery | 基础 | 使用 jQuery 表单过滤选择器

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

随机推荐

  1. perl 自动发产品

    use Net::SMTP; use LWP::UserAgent; use HTTP::Cookies; use HTTP::Headers; use HTTP::Response; use Enc ...

  2. IT第十八天 - 类的封装、继承、重载、上周总结★★★

    IT第十八天 上午 封装 1.关键字this,是表示该类在实例化时的对象,即this.表示为该对象的属性 2.类的数据保护,set.get方法的写法规则,为了之后的反射机制的读取数据,set方法中对于 ...

  3. 最全的LBS手机定位技术说明

    随着手机技术的发展定位方式也发生了非常大的变化.获取手机位置有非常多种方式. 第一种:CELL-ID定位原理 通过移动网络获取设备当前所在的Cell信息来获取设备当前位置.当设备位置更新设备会向当前服 ...

  4. Unity KillCount

    using UnityEngine; using System.Collections; public class KillCountMult : MonoBehaviour { public GUI ...

  5. org.tigris.subversion.javahl.ClientException: Attempted to lock an already-locked dir svn: Working c

    Eclipse插入svn提交出现:org.tigris.subversion.javahl.ClientException: Attempted to lock an already-locked d ...

  6. JavaScript 高级程序设计(第3版)笔记——chapter4:变量、作用域和内存问题

    Chapter4 变量.作用域和内存问题 l  理解基本类型和引用类型的值 l  理解执行环境 l  理解垃圾收集 4.1基本类型和引用类型的值 l  ECMAScript变量包含两种不同数据类型的值 ...

  7. AddSelf

    今天看     C语言深度深度解剖  第58页 看到了这么一段代码,就敲进了dev 谁知居然出现了个死循环.但是我不知道为什么. 贴出来,等有空了再请教别人好好分析,或者是网络上的高人指点一下 //d ...

  8. Calling 64-bit assembly language functions lodged inside the Delphi source code

    Code: http://www.atelierweb.com/calling-64-bit-assembly-language-functions-lodged-inside-the-delphi- ...

  9. JProtector java应用加密工具

    JProtector    专业的java项目加密工具 JProtector简介: JProtector 专业的java项目加密工具.目前java开发的项目发布的时候需要将项目发布到用户手中,但由于一 ...

  10. 2013年最好的Python开源项目汇总

    2013年Python社区诞生了很多实用的开发工具,这些工具 在一定程度上 可以帮助你节省更多的时间.本文为你汇总了这些工具,它们大部分都是开源的,你还可以通过源码来学习更多的Python开发知识. ...