if does not have class jquery code example

Example 1: jquery check if element has class starting with

/* Answer to: "jquery check if element has class starting with" */

if(!$(this).is('[class*="answerbox"]')) {
    //Finds element with no answerbox class
} else {
    //The element has already an answerbox class
}

Example 2: has not class jquery

if (!$(this).hasClass("test")) {

Example 3: jQuery hasClass() - check for more than one class

element.is('.class1, .class2')
// works, but it's 35% slower than

element.hasClass('class1') || element.hasClass('class2')

//https://stackoverflow.com/questions/2214952/jquery-hasclass-check-for-more-than-one-class