I have a div with a class .tour_head1 and there's always an h3 element and many div with content. I want to check if the tour_head1 has only h3 element and divs with no content, then remove the whole div .tour_head1
HTML
<div class="tour_head1">
<h3>Description</h3>
<div> <p> </p> </div>
<div></div>
</div>
JQuery
$('.tour_head1:has(h3:only-child)').filter(function() {
return !this.textContent.trim();
}).remove();
});