javascript vanilla classlist contains class code example
Example 1: javascript hass class
if (myElement.classList.contains('someClassname')) {
// do something
}
Example 2: js check for class in classList
element.classList.contains(className);