How can I get the next div element and then all of its children?
<div class="1"></div>
<div class="2">
<div class="child1"></div>
<div class="child2"></div>
</div>
<div class="3">
<div class="child1"></div>
</div>
so, if $(this)
currently is class 1, how can i get to only class 2 and all of its children. And I can't reference it by its class name since i won't know what that is.
I'm basically looking to merge these 2 statements into 1.
$(this).next('div').animate({height : 'toggle'});
$(this).next('div *').animate({height : 'toggle'});
$(this).next('div').children().andSelf().animate({height : 'toggle'});
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