js has classt code example
Example 1: javascript hass class
if (myElement.classList.contains('someClassname')) {
// do something
}
Example 2: how to check has class name in js?
element.classList.contains(className);Code language: CSS (css)
if (myElement.classList.contains('someClassname')) {
// do something
}
element.classList.contains(className);Code language: CSS (css)