check if a class exists on a div using another class in javascript code example
Example 1: javascript hasclass
if (document.body.classList.contains('thatClass')) {
// do some stuff
}
Example 2: jquery check if a class exists
if ($(".mydivclass")[0]){
// Do something if class exists
} else {
// Do something if class does not exist
}