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

jQuery 带空格选择器的注意事项

时间:2015-04-20 13:17:44      阅读:133      评论:0      收藏:0      [点我收藏+]

标签:jquery选择器

<div class="test">
    <div style="display:none;">aa</div>
    <div style="display:none;">bb</div>
    <div style="display:none;">cc</div>
    <div class="test" style="display:none;">dd</div>
</div>
<div class="test" style="display:none;">ee</div>
<div class="test" style="display:none;">ff</div>

$(‘.test :hidden‘).length //带空格 输出4 :选出class为‘test’元素里的隐藏元素
$(‘.test:hidden‘).length //不带空格 输出3 :选出隐藏的class为‘test’的元素

从《轻量级javaEE企业应用实战》中记载,学习笔记。

本文出自 “java程序猿的博客” 博客,请务必保留此出处http://chengxuyuan.blog.51cto.com/5789198/1635962

jQuery 带空格选择器的注意事项

标签:jquery选择器

原文地址:http://chengxuyuan.blog.51cto.com/5789198/1635962

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