jQuery选择器

基本选择器 实例 选取
* $("*") 所有元素
#id $("#lastname") id="lastname"元素
.class $(".intro") 所有class="intro"元素
.element $("p") 所有p元素
.class.class $(".intro.demo") 所有class=intro且class=demo元素
s1,s2,s3 $(tr,td,intro) 所有带有匹配选择的元素
[attribute] $("[href]") 所有带有href属性的元素
[attribute=value] $("[href='#']") 所有href属性的值等于#的元素
[attribute!=value] $("[href!='#']") 所有href属性的值不等于#的元素
[attribute$=value] $("[href$='.jpg']") 所有href属性的值包含已.jpg结尾的元素
     
form表单    
:input    
:text    
:password    
:radio    
:checkbox    
:submit    
:reset    
:button    
:image    
:file    
     
顺序选择器    
:first    
:last    
:even    
:odd    
     
比较选择器    
:eq(index)    
:gt(no)    
:lt(no)    
:not(selector)    
     
其他    
:header    
:animated    
:contains(text)    
:empty    
:hidden    
:visible    
     
状态选择器    
:enabled    
:disabled    
:selected    
:checked    
posted @ 2013-04-23 15:29  全新时代-小小程序员大梦想  阅读(154)  评论(1编辑  收藏  举报