Code Snippet
Check for Empty Elements
Do something for each empty element found:
$('*').each(function() {
if ($(this).text() == "") {
//Do Something
}
});TRUE or FALSE if element is empty:
var emptyTest = $('#myDiv').is(:empty);
This might be a bit more practical
$(‘p,em,b,strong,span’).each(function() {
if (jQuery.trim ($(this).text()) == “”) $(this).css(‘border’,'solid 1px red’);
});