I need to run a function inside a conditional statement based on whether or not 3 elements have a class.
In short, if (elm1, elm2, elm3) have the class "include" then ring true. But all 3 elements must have the class, it can not ring true if only 2 or 1 has the class.
<div class="elm1" class="include"></div>
<div class="elm2" class="include"></div>
<div class="elm3" class="include"></div>
jQuery('#search-submit').click(function() {
if (#elm1, #elm2, #elm3).hasClass('include'){
/* return true */
} else {
/* return false */
}
}
Needless to say this doesn't work.
<div>
elements have the "include" class? Or do you only need at least 1? (If you need 3, I'm quite certain the answer you accepted is wrong, but by all means - validate this)