码迷,mamicode.com
首页 > Web开发 > 详细

jQuery选择器

时间:2016-11-04 22:55:21      阅读:172      评论:0      收藏:0      [点我收藏+]

标签:.text   伪类   nbsp   check   show   效率   表单   first   单选   

1.ID选择器(js一般尽量用ID选择器,效率最高)

$("#id").html();

$(".className").text();

2.类选择器

$(".className").text();

3.标签选择器

$(‘p‘).click();

4.属性选择器

$("li[id]")、 $("li[id=‘link‘]").fadeIn();

5.层级选择器

$("li .link").show();

6.父子选择器

$("ul > li")

7.伪类选择器

$("p:first")

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

8.表单选择器

$(":text")

$(":checkbox")

$(":checked")

 

jQuery选择器

标签:.text   伪类   nbsp   check   show   效率   表单   first   单选   

原文地址:http://www.cnblogs.com/future-zmy/p/6031574.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!