I'm trying to create an "if" statement in jQuery to check if an element has one (or more) of a list of classes AND one (or more) of another list of classes. I don't seem to be having success. My code I've created so far is:
if ( $("#jacket_text").is(".color-white,.color-black,.color-silver")
&& $("#jacket_text").is(".font-block,.font-script,.font-space") ) {
}
else {
}
Is there something I can do to make this work?
Any help greatly appreciated! Thanks!
**** EDIT ****
Here is a jsFiddle of more code that I am using: https://jsfiddle.net/4wajbutx/
I'm sorry if it's a bit complex, I wanted to include as much as possible to make sure any of my errors could be noticed, if there were any causing problems.
The point of my code here is that certain colors (such as white & black) should NOT be available when someone clicks the "neon" font option. I managed to handle that - it would deselect those colors and select "blue" when they clicked "neon." The problem is that if they have already selected "neon" and, say, the color "pink," if they click "neon" again (accidentally perhaps) then it changes their color selection to "blue." But this should ONLY happen if they have a different font option selected AND an invalid color option selected.
Wow I hope that makes sense to someone.