Using plain JavaScript (not jQuery), Is there any way to check if an element contains a class?
Currently, I\'m doing this:
Using the classList is also ideal
HTML
JavaScript
const element = document.querySelector("#box"); element.classList.contains("myClass");