选择器jquery |
实例动画 |
选取spa |
*ci |
$("*")element |
全部元素字符串 |
#idget |
$("#lastname")input |
id="lastname" 的元素it |
.classio |
$(".intro") |
全部 class="intro" 的元素 |
$("p") |
全部 <p> 元素 |
|
.class.class |
$(".intro.demo") |
全部 class="intro" 且 class="demo" 的元素 |
$("p:first") |
第一个 <p> 元素 |
|
$("p:last") |
最后一个 <p> 元素 |
|
$("tr:even") |
全部偶数 <tr> 元素 |
|
$("tr:odd") |
全部奇数 <tr> 元素 |
|
$("ul li:eq(3)") |
列表中的第四个元素(index 从 0 开始) |
|
$("ul li:gt(3)") |
列出 index 大于 3 的元素 |
|
$("ul li:lt(3)") |
列出 index 小于 3 的元素 |
|
:not(selector) |
$("input:not(:empty)") |
全部不为空的 input 元素 |
$(":header") |
全部标题元素 <h1> - <h6> |
|
|
全部动画元素 |
|
$(":contains('W3School')") |
包含指定字符串的全部元素 |
|
$(":empty") |
无子(元素)节点的全部元素 |
|
:hidden |
$("p:hidden") |
全部隐藏的 <p> 元素 |
$("table:visible") |
全部可见的表格 |
|
s1,s2,s3 |
$("th,td,.intro") |
全部带有匹配选择的元素 |
$("[href]") |
全部带有 href 属性的元素 |
|
$("[href='#']") |
全部 href 属性的值等于 "#" 的元素 |
|
$("[href!='#']") |
全部 href 属性的值不等于 "#" 的元素 |
|
$("[href$='.jpg']") |
全部 href 属性的值包含以 ".jpg" 结尾的元素 |
|
$(":input") |
全部 <input> 元素 |
|
$(":text") |
全部 type="text" 的 <input> 元素 |
|
$(":password") |
全部 type="password" 的 <input> 元素 |
|
$(":radio") |
全部 type="radio" 的 <input> 元素 |
|
$(":checkbox") |
全部 type="checkbox" 的 <input> 元素 |
|
$(":submit") |
全部 type="submit" 的 <input> 元素 |
|
$(":reset") |
全部 type="reset" 的 <input> 元素 |
|
$(":button") |
全部 type="button" 的 <input> 元素 |
|
$(":image") |
全部 type="image" 的 <input> 元素 |
|
$(":file") |
全部 type="file" 的 <input> 元素 |
|
$(":enabled") |
全部激活的 input 元素 |
|
$(":disabled") |
全部禁用的 input 元素 |
|
$(":selected") |
全部被选取的 input 元素 |
|
$(":checked") |
全部被选中的 input 元素 |