How can I hide divs if they are empty?

jQuery has a :empty selector. So, you can simply do:

$('div.section:empty').hide();

Leave a Comment