Thursday, October 5, 2023
 Popular · Latest · Hot · Upcoming
156
rated 0 times [  163] [ 7]  / answers: 1 / hits: 32160  / 14 Years ago, mon, august 3, 2009, 12:00:00

How would I check if all the div's with class test are hidden. And if they are all hidden set wrap1 to hidden. Thanks.



<div id='wrap1'>
<div class=header>Header 1</div>
<div class='test'><a href=#>Test 1</a></div>
<div class='test'><a href=#>Test 2</a></div>
<div class='test'><a href=#>Test 3</a></div>
</div>


UPDATE:
Thanks everyone for the really quick answers, I got it working. They were all very helpful.


More From » jquery

 Answers
7

You can do the check as by using selector as suggested above and to it like this:



 if ( $(div.test:visible).length === 0)
$(#wrap1).hide( );

[#99008] Wednesday, July 29, 2009, 15 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
tristani

Total Points: 318
Total Questions: 95
Total Answers: 106

Location: Saint Lucia
Member since Wed, Feb 8, 2023
9 Months ago
;