/*    六丶筛选        */
// console.log( $("div:first") ); // div#id_1 所有div中的第一个
// console.log( $("div:last") ); // div#id_4 所有div中的最后一个
// console.log( $("div:not(#id_1)") ); // id不id_1的所有div
// console.log( $("div:even") ); // 返回索引是偶数的div 总共12个div
// console.log( $("div:odd") ); // 返回索引是奇数的div 总共12个div
// console.log( $("div:eq(3)") ); // 返回索引 (等于3) 的div(索引从0开始)
// console.log( $("div:gt(3)") ); // 返回索引 (大于3) 的div(索引从0开始)
// console.log( $("div:lt(3)") ); // 返回索引 (小于3) 的div(索引从0开始)
// console.log( $(":header") ); // 获取所有h1,h2,h3..h6
// console.log( $(":focus") ); // 获取获得焦点的元素
// console.log( $(":animated") ); // 获取执行动画的元素
// console.log( $("div").filter('#id_2_2') ); // 在div中筛选#id_2_2
// console.log( $("div").has('#id_2_1_1') ); // 在div中筛选(后代)有#id_2_1_1的
// console.log( $("div").not('#id_2_1_1') ); // id不#id_2_1_1的所有div
// console.log( $("div").slice(1,2) ); // div.class_1
// console.log( $("#id_2").children() ); // span, div#id_2_1, div#id_2_2, div#id_2_3, h1, h3,
// console.log( $("#id_2").prev() ); // <span>1_3</span>
// console.log( $("#id_2").prevAll() ); // span, div.class_1, div#id_1
// console.log( $("#id_2_1").next() ); // #id_2_1(兄弟)元素里下一个元素
// console.log( $("#id_2_1").next("div") ); // #id_2_1(兄弟)元素里下一个div(紧邻的),没有的话就返回空
// console.log( $("#id_2_1").nextAll("div") ); // #id_2_1后面(兄弟)元素里所有div
// console.log( $("#id_2_2").siblings("div")); // #id_2_1所有(兄弟)元素(包括前面)里所有div

JQuery-筛选的更多相关文章

  1. jQuery 筛选器1

    jQuery 筛选器1 筛选器1: 在选择器选择的基础上在选择一次 // 当前点击的标签$(this) $(this) // .next() 获取当标签的下一个标签 $(this).next(); / ...

  2. jQuery 筛选器2

    jQuery 筛选器2 // 由于$()只能输入字符串$('#li:eq(1)'),可通过.eq()来传入. // 获取this标签中的指定属性 $(this).eq(1) // 获取第一个元素 $( ...

  3. jQuery筛选结果等于true的筛选

    一般来说,使用jQuery筛选器的筛选结果都是数组,可以用length>0来判断是否筛选到:但是有一些筛选结果是布尔值,需要注意: 1.hasClass 2.is

  4. jQuery筛选器及对DOM修改(学习笔记)

    1.jQuery筛选器 注意:请先在管理Nuget程序包中查找jQuery包,并安装.也可以在jQuery官网下载. 实现: <!DOCTYPE html> <html xmlns= ...

  5. jquery筛选元素函数

    jquery筛选元素函数 1.过滤匹配第二个p元素: $("button").click(function(){ $("p").eq(1).css(" ...

  6. jquery-5 jQuery筛选选择器

    jquery-5  jQuery筛选选择器 一.总结 一句话总结:选择器加动态添加方法可以不用想方法名,这个简单方便. 1.筛选选择器有哪三种? 过滤 查找 串联 1.过滤 eq();first(); ...

  7. jQuery---jq基础了解(语法,特性),JQ和JS的区别对比,JQ和JS相互转换,Jquery的选择器(基础选择器,层级选择器,属性选择器),Jquery的筛选器(基本筛选器,表单筛选器),Jquery筛选方法

    jQuery---jq基础了解(语法,特性),JQ和JS的区别对比,JQ和JS相互转换,Jquery的选择器(基础选择器,层级选择器,属性选择器),Jquery的筛选器(基本筛选器,表单筛选器),Jq ...

  8. JQuery筛选器全系列介绍

    jQuery提供了强大的选择器让我们获取对象.在这边,我人为地将jQuery选择器分为两大部分:选择对象和筛选条件.选择对象表示要获取什么对象,筛选条件是对获取的对象进行筛选,最终留下符合某些特征的对 ...

  9. 【jQuery】jQuery筛选器规则

    转载自:http://blog.csdn.net/lijinwei112/article/details/6938134 筛选器中加入变量 var ac = "select_" + ...

  10. 使用jQuery筛选排除元素以修改指定标签的属性

    简单案例: $(function(){ $("td[id][id!='']").click(function(){ //你的逻辑 }); }); 上述代码,有id且id不为空的td ...

随机推荐

  1. Python int与string 的转换

    string → int 1.10进制的string转化为int int('12')  → type(int('12')) 进行验证 2.16进制的string转化为int int('12', 16) ...

  2. mac笔记

    chrome F12快捷键 option+command+i updatedb: http://www.jeffkit.info/2010/04/66/ /usr/libexec/locate.upd ...

  3. 偶然的发现(与Code无关)

    最近做后台用户注册, 在考虑不使用验证码, 百度搜了一下看了看一些相关技术, 发现了个小说——[万恶的验证码], 看了挺搞笑分享一下:原文链接 万恶的验证码 前言: 传说中,它是最为邪恶的吸血鬼,它是 ...

  4. CentOS 6.4 查看每个进程的网络流量

    所需工具nethogs 安装:yum install -y nethogs 使用:nethogs eth0

  5. Codeforces Round #251 (Div. 2) C. Devu and Partitioning of the Array

    注意p的边界情况,p为0,或者 p为k 奇数+偶数 = 奇数 奇数+奇数 = 偶数 #include <iostream> #include <vector> #include ...

  6. POJ 1329 Circle Through Three Points(三角形外心)

    题目链接 抄的外心模版.然后,输出认真一点.1Y. #include <cstdio> #include <cstring> #include <string> # ...

  7. DB2支持的三种表空间SMS、DMS、DMS的自动存储

    DB2支持的三种表空间SMS.DMS.DMS的自动存储 DB2中,表空间是数据库与这个数据库中存储的表之间的逻辑层.表空间在数据库中创建,表在表空间中创建.容器是一个物理存储设备.它可以由目录名.设备 ...

  8. 通过串口设备vid,pid自动获得该设备所对应的串口号

    用C#做串口通讯很方便,因为dotfx2.0已经集成了Serial Port控件,此控件使用上比MSComm控件更简单,当然它也有一个小bug (RecievedBytesThreshold设置有时候 ...

  9. Bone Collector(01背包)

    题目链接:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=87125#problem/N 题目: Description Many year ...

  10. Lanterns

    Lanterns 题目链接:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=86640#problem/B 题目: Description ...