Example html:
<div class="red"></div>
<div class="green"></div>
<div class="blue"></div>
<div class="apple"></div>
I want to loop through the divs and filter them out if they don't have a class of either 'red', 'green', or 'blue'.
var onlyColorDivs = $('div').hasClass( __________ );
Is there a way to filling the blank in the previous line to accomplish this. Or am I going to have to put my list color classes in an array and do a loop?
Let me know if any clarification is needed.