I have the following elements:
$('div').each(function () {
var found = false;
var element_classes = $(this)[0].className.split(/\s+/);
// Loop each class the element has
for (var i = 0; i < element_classes.length; i++) {
// Check if each class from the element is within the array of classes we want to match
if (['nine', 'ten', 'eleven'].indexOf(element_classes[i]) !== -1) {
// We found a match, break out of the loop
found = true;
break;
}
}
// check if found or not
if (found) {
// Was found
}
else {
// Was not found
}
});