How to check if there is any visible element or vice versa within a <div>
?
I can get around with jQuery and tried using el.is(':visible')
but I could not because I need to check if everyone inside <div>
is hidden.
How to check if there is any visible element or vice versa within a <div>
?
I can get around with jQuery and tried using el.is(':visible')
but I could not because I need to check if everyone inside <div>
is hidden.
With your friend's comment @marcelobonifazio
The author was able to use:
var divFilho = divPai.find('ul:visible').length;
if(divFilho === 0){
divPai.hide().addClass('hidden');
}