美文网首页
jQuery 选择器总结

jQuery 选择器总结

作者: 牧马人_hlc | 来源:发表于2016-09-09 10:43 被阅读14次

jQuery Selectors

Basics

$('code')
$('#myid')
$('.myclass')
$('*')
$('code, #myid, .myclass')

Hierarchy

$('div code')
$('li > ul')
$('strong + em') /后面一个/
$('strong ~ em') /后面的/

Basic Filters

$('li:first')
$('li:last')
$('li:not(li:first)')
$('li:even')
$('li:odd')
$('li:eq(1)')
$('li:gt(2)')
$('li:lt(2)')
$(':header')
$(':animated')

Content Filters

$('li:contains(second-level)')
$(':empty')
$('li:has(a)')
$('p:parent')

Visibility Filters

$(':hidden') //display none
$(':visible') //display not none

Attribute Filters

$('li[class]')
$('a[xxx="self"]')
$('a[rel!="nofollow"]')
$('[class^="my"]')
$('[class$="my"]')
$('a[href*="zip"]')
$('a[rel][href][title="blog"]')

Child Filters

$('li:first-child')
$('li:last-child')
$('li:nth-child(even)')
$('li:nth-child(odd)')
$('li:nth-child(2)')
$('li:nth-child(2n)')
$('code:only-child')

Forms

$(':input')
$(':text')
$(':password')
$(':radio')
$(':checkbox')
$(':submit')
$(':image')
$(':reset')
$(':button')
$(':file')

Form Filters

$('input:enabled')
$(':disabled')
$(':checked')
$(':selected')

相关文章

  • jQuery选择器总结

    参考 jQuery选择器总结 jQuery 的选择器可谓之强大无比,这里简单地总结一下常用的元素查找方法 $("#...

  • jquery选择器书目录

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

  • JQUERY一

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

  • jQuser有选择器

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

  • jQuery选择器

    jQuery基本选择器 总结:跟css的选择器用法一模一样。 jQuery层级选择器 跟CSS的选择器一模一样。 ...

  • 选择器

    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 选择器总结

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