I have the following class:
<div class='prod-item'>
</div>
I may have multiple versions of this class within the DOM. Is it possible to iterate through each, and remove those with no inner HTML elements?
For example, this can stay:
<div class='prod-item'>
<p>Pussy</p>
</div>
This should go:
<div class='prod-item'>
</div>
I have the following incomplete function, but I'm unsure on how to check if inner elements exist:
$('li[class="prod-item"]').each(function() {
if(){
this.removeAttribute('class');
}
});