时间:2021-07-01 10:21:17 帮助过:8人阅读
输出结果分别为:2和3;
<html>
<head>
<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
var $a1=$(".test :hidden");
var $a2=$(".test:hidden");
alert($a1.length+" "+$a2.length)
})
</script>
<style>
</style>
</head>
<body>
<div class="test" style="display:none;">
<p style="display:none">dddddddd</p>
<p style="display:none">dddddddd</p>
</div>
<div class="test" style="display:none">
</div><div class="test" style="display:none"></div>
<body>
</html>