I have code like above
` <ul id="jsddm">
<li><a href="Default.aspx">
Menu</a>
<ul style="visibility: hidden;">
<li><a href="Content.aspx?ID=153">
SubMenu</a></li>
<li><a href="Content.aspx?ID=152">
SubMenu</a></li>
</ul>
</li>
<li><a href="#">
Menu</a>
<ul style="visibility: hidden;">
</ul>
</li>
</ul>
</div>`
I want to romove empty sub "ul" tags which is has got not "li" tag(s) with jquery when my page onload. How can I do? Thanks for help.
$('ul').not(':has(li)').remove();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With