Suppose I have 5 div classes named .content inside a div with an id #container. I want to remove the first 4 and leave only the last one. How am I suppose to do it in jquery?
<div id="container">
<div class="content"> </div>
<div class="content"> </div>
<div class="content"> </div>
<div class="content"> </div>
<div class="content"> </div>
</div>
Please help.
You could use the appropriate selector as well.
Meaning every
.contentdiv except the one that are the last child of their parents.