I am using the following script to find all h1 elements, within a parent ID container that will fit a curtain criteria...
$(\'#cpcompheader h1\').html(\"&nbs
you could filter your element using regex, and then remove it if dont have any value
$('h1').each(function(){ var filtered = $(this).html($(this).html().replace(/ /gi,'')); if($(filtered).html() === ''){ $(filtered).remove(); } });
here a demo