I want to append some text after 2 closing divs to a sector element.
<a href="" class="thingIClicked">Click me</a>
</div>
</div>
// this is where I want to append the text
My code appends the text after the link. How can I say “append it after the 2nd closing div”?
$('a.thingIClicked').click(function() {
$(this).append('hello');
});
There’s probably a more elegant solution, but how about:
Edit: @Zack is correct (and should probably get the answer credit for this one) – my original code would have added the text into the second enclosing
div, rather than after it. I’ve edited my code above accordingly.