jQuery remove all li elements with empty a childs

How do I remove all <li></li> elements with an empty <a></a> tag?

Example:

<li><a href=''>List item</a></li> //Do not delete
<li><a href=''></a></li> //Delete

solution

You could combine the :has()/ :empty jQuery selectors:

Example Here

$('li:has(a:empty)').remove();