if this has class vanilla js code example Example: javascript hass class if (myElement.classList.contains('someClassname')) { // do something }