check if all h5 are empty
by Joe Saad
HTML
<h5>ds</h5>
<h5>ds</h5>
<h5>dsad</h5>
<h5>ee</h5>
JavaScript
$(function(){
valt = false;
alert($('h5').length);
if (valt) {
alert('all is empty');
}
var emptyHs = $('h5').filter(function() {
return $(this).is(':empty');
});
alert(emptyHs.length);
if (emptyHs.length<=0) {
alert('nothing is empty');
}
});