I wanted to ask about the best way to write this JQUERY code.
I have DOM structure like this:
<div id="chatCenterMembers">
<div id="adam" class="chatmember 100">
<div class="newchatmessage" style="display: block;"></div>
</div>
<div id="steven" class="chatmember 101">
<div class="newchatmessage"></div>
</div>
</div>
I want to extract a list of userid’s – eg: 100, 101 class names into array where the DIV with class “newchatmessage” has the style set to display block – eg: its visable.
I can do it with a $.each loop but its appears inefficient.
Is there a better way? thx
You could collect all needed visible elements just like that: