How can I delete list element if it has a child link of some defined id ? So looking at the code below I'd like to find a <li>
with <a>
of id=link1
and delete this li
.
<li class="nav-tab">
<a href="#link1">Component</a>
</li>
I've tried the code below but it doesn't work :
$(function() {
$('.nav-tab:has(#link1)').css('display', 'none');
});