I wonder how to hide all elements until found the first <hr/>
. Then the loop should stop
<div class='row-father'>
<legend> Title here </legend>
<div class="row-fluid">...</div>
<div class="row-fluid">...</div>
<hr/>
<div class="row-fluid">...</div>
<div class="row-fluid">...</div>
<div class="row-fluid">...</div>
<div class="row-fluid">...</div>
<hr/>
<div class="row-fluid">...</div>
<div class="row-fluid">...</div>
<hr/>
</div>
...
$('.row-father').find('*').each(function(){
if ($(this) != '<hr/>')
$(this).hide();
});
Use this: $('.row-father > hr:first').prevAll(':not(legend)').hide();
See http://api.jquery.com/prevall/
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