so say I have:
<li>
<span id="foo">bar</span>
</li>
<li>
<span id="abc">123</span>
</li>
and I want to remove the li with child “span id=foo”. How do I do that with Jquery?
I tried something like:
$("li:has(span[id=foo])").remove();
does not seem to be working… Any thoughts? Thanks!
Just try this:
DEMO
But it seems your code is just working fine. See here