I have to remove a div with an empty ul tag in it.
EDIT: The ul tag is not empty, it has a bunch of whitespace in it.
I want to do this with jQuery
This is what I have so far:
$('trim(#menu):empty').parent().remove();
Where the id of my div is 'menu'.
Example:
before:
<div id="container>
<div id="menu">
<ul>
</ul>
</div>
</div>
after:
<div id="container>
</div>
Thanks in advance!
Stijn
:empty
won't select a node that contains whitespace, because that's considered a text node.