I can get all the children of an element with this code
$('#all').children().each(function() { .... });
But how can i get all visible children with class "one" from id="all"
?
<div id="all">
<div>asdd</div>
<div class="one">content</div>
<div class="one">bla</div>
<div>
ssss
<div class="one" style="display:none">text</div>
</div>
<div class="one" style="display:none">blub</div>
</div>
You can use the :visible
filter selector like this:
$('#all').find('.one:visible').each(function(){
// your code....
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With