Have a selector require 2 classes instead of just 1.

Have a selector require 2 classes instead of just 1.

So I understand you can do:

$(".className").xxx
.

Is there an easy way with jquery to have it match 2 classes. So maybe I only want the action to take place it the element has class1 and class2.

$(".class1" , ".class2").xxx


The above is close to what I would like, but thats if any of the 2 classes match, go. I need it to be both.

I can probably do this with some basic javascript logic.. just figure there may be a function for this already.