I'm trying to identify an empty element that might or might not contain a comment tag and/or white space.
The following HTML structure is common place in the environment I'm working with:
<div class="container container-no-title">
<div id="dnn_ctr6735_ContentPane" class="container-padding DNNAlignright">
<!-- Start_Module_6735 -->
<div id="dnn_ctr6735_ModuleContent">
<!-- End_Module_6735 -->
</div>
</div>
</div>
My initial jQuery was:
$('.container-padding > div').each(function() {
if ($(this).is(":empty")) {
$(this).parent('.container-padding').remove();
};
});
But this doesn't account for whitespace or comment tags. I found other questions that addressed whitespace, but nothing that addresses comment tags, and I'd really like to keep this little snippet of jQuery simple.
Cheers, Steve