Reputation: 16596
I need to remove tags going after #first
and only in #container
.
How can I do it with jQuery?
<div id="container">
<div id="first"></div>
<div id="remove_me_1"></div>
<div id="remove_me_2"></div>
<div id="remove_me_3"></div>
<a href="" id="remove_me_too">Remove me too</a>
</div>
Thank you
Upvotes: 5
Views: 902
Reputation: 8166
You can use nextAll
method: http://api.jquery.com/nextAll/
$("#first").nextAll().remove();
Upvotes: 11