Reputation: 2181
If you have
<div id="sf_53" class="req">
<div class="expF"><a href="#">CLICK HERE</a></div>
</div>
<div class="exp"></div>
and your click function was activated by "expF", how do you add html to the next instance of "exp"?
I thought knowing the main parent div would make it like
$("#sf_53").nextAll(".exp").html("Howdy!");
Thanks for taking a look.
Upvotes: 0
Views: 327
Reputation: 82241
use .closest()
with .next()
:
$(this).closest('.req').next().html('somehtml');
Upvotes: 2