I've got multiple elements with a common
class. How do I check each element and add if the class isn't there?
This is what I did but not sure if it's the way to do it.
$(".common").each(function(){
if (!$(this).hasClass("test")) {
//do some
}
};