检查空元素

Avatar of Chris Coyier
Chris Coyier

对找到的每个空元素执行操作

$('*').each(function() {
         if ($(this).text() == "") {
                   //Do Something
         }
});

元素是否为空的 TRUE 或 FALSE

var emptyTest = $('#myDiv').is(':empty');