javascript check if element has class

51

check if a class exists javascript -

const element = document.querySelector("#box");

element.classList.contains("active");

Comments

Submit
0 Comments