Selector
Example
Selects
* |
$("*") |
All elements |
#id |
$("#lastname") |
The element with id=lastname |
.class |
$(".intro") |
All elements with class="intro" |
element |
$("p") |
All p elements |
.class.class
|
$(".intro.demo") |
All elements with the classes "intro" and "demo" |
|
|
|
:first |
$("p:first") |
The first p element |
:last |
$("p:last") |
The last p element |
:even |
$("tr:even") |
All even tr elements |
:odd |
$("tr:odd") |
All odd tr elements |
|
|
|
:eq(index) |
$("ul li:eq(3)") |
The fourth element in a list (index starts at 0) |
:gt(no) |
$("ul li:gt(3)") |
List elements with an index greater than 3 |
:lt(no) |
$("ul li:lt(3)") |
List elements with an index less than 3 |
:not(selector) |
$("input:not(:empty)") |
All input elements that are not empty |
|
|
|
:header |
$(":header") |
All header elements h1, h2 ... |
:animated |
$(":animated") |
All animated elements |
|
|
|
:contains(text) |
$(":contains('W3Schools')") |
All elements which contains the text |
:empty |
$(":empty") |
All elements with no child (elements) nodes |
:hidden |
$("p:hidden") |
All hidden p elements |
:visible |
$("table:visible") |
All visible tables |
|
|
|
s1,s2,s3
|
$("th,td,.intro") |
All elements with matching selectors |
|
|
|
[attribute] |
$("[href]") |
All elements with a href attribute |
[attribute=value] |
$("[href='default.htm']") |
All elements with a href attribute value equal to "default.htm" |
[attribute!=value] |
$("[href!='default.htm']") |
All elements with a href attribute value not equal to "default.htm" |
[attribute$=value] |
$("[href$='.jpg']") |
All elements with a href attribute value ending with ".jpg" |
[attribute^=value] |
$("[href^='jquery_']") |
All elements with a href attribute value starting with "jquery_" |
|
|
|
:input |
$(":input") |
All input elements |
:text |
$(":text") |
All input elements with type="text" |
:password |
$(":password") |
All input elements with type="password" |
:radio |
$(":radio") |
All input elements with type="radio" |
:checkbox |
$(":checkbox") |
All input elements with type="checkbox" |
:submit |
$(":submit") |
All input elements with type="submit" |
:reset |
$(":reset") |
All input elements with type="reset" |
:button |
$(":button") |
All input elements with type="button" |
:image |
$(":image") |
All input elements with type="image" |
:file |
$(":file") |
All input elements with type="file" |
|
|
|
:enabled |
$(":enabled") |
All enabled input elements |
:disabled |
$(":disabled") |
All disabled input elements |
:selected |
$(":selected") |
All selected input elements |
:checked |
$(":checked") |
All checked input elements |
相关推荐
jQuery Selectors Refcard
jQuery-Selectors-源码.rar
本系列文章分为:基本篇、层次篇、简单篇、内容篇、可见性篇、属性篇、子元素篇、表单篇、表单对象属性篇共9篇文章。 本篇讲解::contains(text),:empty,...jQuery-Selectors-4 .div { width:95%; margin-left:15px;
We start off with a quick glance through the basics of JQuery, followed by the explanation of JQuery selectors, filters, and DOM element manipulation. After this, you will learn how events and ...
本系列文章分为:基本篇、层次篇、简单篇、内容篇、可见性篇、属性篇、子元素篇、表单篇、表单对象属性篇共9篇文章。...jQuery-Selectors-2-bynet .div { width:95%; margin-left:15px; margin-top:15px; margin
本系列文章分为:基本篇、层次篇、简单篇、内容篇、可见性篇、属性篇、子元素篇、表单篇、表单对象属性篇共9篇文章。...jQuery-Selectors-9 .div { width:95%; margin-left:15px; margin-top:15px; margin-right
我的学习方法:先入门,后进阶!本系列文章分为:基本篇、...jQuery-Selectors .div { width:95%; margin-left:15px; margin-top:15px; margin-right:15px; padding-left:5px; padding-top:5px; padding-botto
Eclipse 常用快捷键 元素事件列表说明 JQuery Effects , JQuery Traversing , JQuery Selectors , JQuery CSS 方法说明
本系列文章主要讲述jQuery框架的选择器(Selectors)使用方法,我将以实例方式进行讲述,以简单,全面为基础,不会涉及很深,我的学习方法:先入门,后进阶!
本系列文章主要讲述jQuery框架的选择器(Selectors)使用方法,我将以实例方式进行讲述,以简单,全面为基础,不会涉及很深,我的学习方法:先入门,后进阶!
jqueryselectors. 基础入门
本系列文章主要讲述jQuery框架的选择器(Selectors)使用方法,我将以实例方式进行讲述,以简单,全面为基础,不会涉及很深,我的学习方法:先入门,后进阶!
3.Quick summary of jQuery selectors 4.Data centric Ajax: the $.ajax function 5.Content-centric Ajax: the load function 6.Handling JSON data 7.Comparing Ajax support to other libraries
jquery实战+jquery实验室。里边有juqery详细内容的讲解以及,针对所讲解的实例,在实验室平台下的实践。实验室分为两个页面lab.selectors.html针对选择器的学习,lab.wrapped.set.html针对代码的学习。欢迎下载