<strong>原理解释:</strong> <br><br>var $t_a=$(".test :hidden") //带空格 表示的是选择class为test里面隐藏的元素; <br>var $t_a=$(".test:hidden")//不带空格 表示的是选择隐藏的class为test的元素; <br><br><strong>举例说明:</strong> <br><div class="codetitle"> <span><a style="CURSOR: pointer" data="91662" class="copybut" id="copybut91662" onclick="doCopy('code91662')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code91662"> <br> <br> <br><script type="text/javascript" src="jquery-1.3.2.min.js"></script> <br><script type="text/javascript"> <BR>$(document).ready(function(){ <BR>var $a1=$(".test :hidden"); <BR>var $a2=$(".test:hidden"); <BR>alert($a1.length+" "+$a2.length) <BR>}) <BR></script> <br><style> <BR></style> <br> <br> <br><div class="test" style="display:none;"> <br><p style="display:none">dddddddd</p> <br><p style="display:none">dddddddd</p> <br> </div> <br><div class="test" style="display:none"> <br> </div> <div class="test" style="display:none"></div> <br> <br> <br> </div> <br>输出结果分别为:2和3;