How to measure the length of a class with the property display:none
Is there a way to measure the elements with a certain class that have
display:none in javaScript jQuery?
For example:
<div class="x" style="display: none;"></div>
<div class="x" style="display: none;"></div>
<div class="x"></div>
If I do this code below I'll get an alert "3" as there is 3 elements with
class="x".
var n = document.getElementsByClassName('x').length;
alert(n);
What would be the proper selector so that my alert show the only 2 classes
"x" with display:none?
Thanks for your help!
No comments:
Post a Comment