jQuery 选择器

选择器jquery

实例动画

选取spa

*ci

$("*")element

全部元素字符串

#idget

$("#lastname")input

id="lastname" 的元素it

.classio

$(".intro")

全部 class="intro" 的元素

element

$("p")

全部 <p> 元素

.class.class

$(".intro.demo")

全部 class="intro" 且 class="demo" 的元素

:first

$("p:first")

第一个 <p> 元素

:last

$("p:last")

最后一个 <p> 元素

:even

$("tr:even")

全部偶数 <tr> 元素

:odd

$("tr:odd")

全部奇数 <tr> 元素

:eq(index)

$("ul li:eq(3)")

列表中的第四个元素(index 从 0 开始)

:gt(no)

$("ul li:gt(3)")

列出 index 大于 3 的元素

:lt(no)

$("ul li:lt(3)")

列出 index 小于 3 的元素

:not(selector)

$("input:not(:empty)")

全部不为空的 input 元素

:header

$(":header")

全部标题元素 <h1> - <h6>

:animated

 

全部动画元素

:contains(text)

$(":contains('W3School')")

包含指定字符串的全部元素

:empty

$(":empty")

无子(元素)节点的全部元素

:hidden

$("p:hidden")

全部隐藏的 <p> 元素

:visible

$("table:visible")

全部可见的表格

s1,s2,s3

$("th,td,.intro")

全部带有匹配选择的元素

[attribute]

$("[href]")

全部带有 href 属性的元素

[attribute=value]

$("[href='#']")

全部 href 属性的值等于 "#" 的元素

[attribute!=value]

$("[href!='#']")

全部 href 属性的值不等于 "#" 的元素

[attribute$=value]

$("[href$='.jpg']")

全部 href 属性的值包含以 ".jpg" 结尾的元素

:input

$(":input")

全部 <input> 元素

:text

$(":text")

全部 type="text" 的 <input> 元素

:password

$(":password")

全部 type="password" 的 <input> 元素

:radio

$(":radio")

全部 type="radio" 的 <input> 元素

:checkbox

$(":checkbox")

全部 type="checkbox" 的 <input> 元素

:submit

$(":submit")

全部 type="submit" 的 <input> 元素

:reset

$(":reset")

全部 type="reset" 的 <input> 元素

:button

$(":button")

全部 type="button" 的 <input> 元素

:image

$(":image")

全部 type="image" 的 <input> 元素

:file

$(":file")

全部 type="file" 的 <input> 元素

:enabled

$(":enabled")

全部激活的 input 元素

:disabled

$(":disabled")

全部禁用的 input 元素

:selected

$(":selected")

全部被选取的 input 元素

:checked

$(":checked")

全部被选中的 input 元素

相关文章
相关标签/搜索