<div class="container">
<div class="form">
<div class="row">
</div>
<div class="row">
</div>
</div>
<div class="form">
<div class="row">
</div>
<div class="row">
</div>
</div>
</div>
New to jquery and was wondering how do you select a specific child of a specific child. Say I want to hide the second row from the second form. I’ve tried
$('.container:nth-child(2)').eq(1).css("display", "none")
and
$('.container').children("form").eq(1).css("display", "none")
but can’t seem to get to the specific child of a specific child.
2
Answers
First you have to find the first element : $(‘.container .form’).eq(1) then get the second element : .find(‘.row’).eq(1)
Use form as class.