So I'm trying to select elements with multiple classes only if the classes are all found in a set of classes.
Example. I have a element with id="foo" and class="red blue"
I then have some given set of colors. From which I want to select all elements that I have within the set.
Lets say i have the set {red} nothing should be found. {red blue} then 'foo' should be found. And then if I have {red blue green} then 'foo' should still be found.
I've tried this with the multiple selectors but it does not work once the set is larger than just {red blue}
$.('.red') will return foo (which is not what I want.)
$.('.red.blue') will return foo (good!)
$.('.red.blue.green') will return nothing (bad.)
I'm not sure the 'or' operator here is what I want either. $.('.red,.blue') will then return any elements with red OR blue, which is not what I want. I've already got that function figured out.
is there any sort of 'all in' function?
I was thinking about just iterating every selection query possible with the set of items, but that becomes a lot of queries very quickly when the set is > 4 items long.
.red.blue.green
?