Have some code to hide a div, if it's contents are empty. This SHOULD work...its' worked before. Am I missing something obvious here? The div class = "msgalert"
$(document).ready(function () {
if ($('.msgalert').is(':empty')) {
$(".msgalert").css({'display':'none'});
}
});
The corresponding CSS is:
.msgalert { border: 1px solid #eac572; background-color: #ffe9ad; }
Please help! Thanks :)
$(".msgalert:empty").css({'display':'none'});work?:emptymeans absolutely no content, including whitespace, so make sure the elements are actually empty.