I have the following code in which I’m trying to hide and show div.validation-summary-errors based on whether or not it has any errors inside
$('div.validation-summary-errors').each(function (index, element) {
if ( ????? ) {
$(element).parent().css({ "visibility": "visible" });
}
else {
$(element).parent().css({ "visibility": "hidden" });
}
});
The mark up looks like the following. This is the case where is should be hidden since the inner li does not have any error inside and display: none
<div class="validation-summary-errors">
<ul>
<li style="display:none"></li>
</ul>
</div>
1 Answer