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 fillin 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?
Thanks! And let me know if any clarification is needed.