美文网首页
jQuery选择器

jQuery选择器

作者: DJMG | 来源:发表于2017-04-13 17:30 被阅读0次

jq选择器,一个非常大的概念,是jQuery开发者必须熟练运用的核心技术。jQuery开发者能够高效的开发,得益于jQuery强大的选择器,使繁琐的DOM操作变得简单。

结合自己平时遇到的问题,对选择器做一个归纳和总结。

选择器形式:$("selector");     //@param selector

一、基本选择器

$(".className") 

$("#id")

$("element")

$("selector1,selelctor2,selectorN")

$("*")

$("parent children")

$("parent > children")

$("prev + next")

$("prev ~ sibling")

jQuery选择器特点之一:延续CSS特点,CSS的语法放在jQuery选择器中一样能用。

二、筛选选择器    

:first

:not(selector)

:even

:odd

:eq(index)

:gt(index)                 // 匹配下标 > index 的元素

:lang

:last

:lt(index)

:header

:animated               // 匹配在执行动画的元素 --->$("div:not(:animated)").animate({ left: "+=20" }, 1000);

:focus

:root                        // 根元素

:target                   

:contains(text)        // 匹配包含此字符串的元素

:empty                    

:has(selector)         // 匹配包含此选择器的元素

:parent                    // 匹配含有子元素或者文本的元素

:hidden                 

:visible

三、属性选择器

[attribute]                                            // $("input[data-attr]")

[attribute=value]                                 // $("input[type=checkbox]")

[attribute!=value]                                // 等价于 :not([attribute=value])  ***:not(selector)本身是一个选择器,并可以插入选择器

[attribute^=value]

[attribute$=value]

[attribute*=value]

[attrSel1][attrSel2][attrSelN]

相关文章

  • jquery选择器书目录

    jquery选择器-基本选择器 jquery选择器-层级选择器 jquery选择器-基本过滤选择器 jquery选...

  • JQUERY一

    jQuery 元素选择器 jQuery 属性选择器 jQuery CSS 选择器 jQuery 事件 jQuery...

  • jQuser有选择器

    jQuery基本选择器 jQuery过滤选择器 jQuery层级选择器 jQuery筛选选择器(方法)

  • 选择器

    jQuery 元素选择器 jQuery 属性选择器 jQuery CSS 选择器

  • jQuery 基础

    jQuery jQuery操作DOM jQuery的选择器 基本选择器 层级选择器 过滤选择器 jQuery操作样...

  • jQuery

    jQuery jQuery操作DOM jQuery的选择器 基本选择器 层级选择器 过滤选择器 jQuery操作样...

  • jQuery选择器

    一、jQuery常用选择器 二、jQuery选择器优势 三、jQuery常用基本选择器 四、jQuery常用层次选...

  • JQuery基础知识

    jQuery操作DOM jQuery的选择器 基本选择器 层级选择器 过滤选择器 jQuery操作样式 css操作...

  • jQuery相关知识

    1、什么是jQuery选择器? jQuery选择器

  • jQuery选择器

    jQuery选择器 jQuery选择器完全继承了CSS的风格。学会使用选择器是学习jQuery的基础,jQuery...

网友评论

      本文标题:jQuery选择器

      本文链接:https://www.haomeiwen.com/subject/afwsattx.html