JSFiddle - React, Tailwind, and code Playground
by skram
HTML
<div>
<a href="#"><span>Link 1</span></a>
<a href="#"><span>Link 2</span></a>
<a href="#">Link 3</a>
</div>
<button> Hide Link with Childrens</button>
CSS
a span {
color: green;
}
JavaScript
$('button').click(function() {
$("div a").filter(function() {
return ($(this).children().length > 0)
}).hide();
});