Is it possible to automatically remove the parent container when all of its children elements have been removed? Each child element has a dismissal option that, when clicked, removes the element.
I am using backbone.js for this project and would like a solution where removing all children would also trigger the removal of the parent container.
<div class="container>
<ul>
<li><a class="dismiss"></a></li>
<li><a class="dismiss"></a></li>
<li><a class="dismiss"></a></li>
</ul>
</div>
Your input is greatly appreciated!