What’s the simplest rule which takes this DOM:
<div>
<ul>
<li>
<div>
<a href="#" class="remove">link</a>
</div>
</li>
<li>
<div>
<span class="ok"></span>
</div>
</li>
<li>
<div class="remove"></div>
</li>
</ul>
</div>
and removes all <li> elements, if any of them has a child at any depth which contains "remove" class. The result html is shown below:
<div>
<ul>
<li>
<div>
<span class="ok"></span>
</div>
</li>
</ul>
</div>
http://api.jquery.com/has-selector/
From the docs:
http://jsfiddle.net/WNcKE/1/