<div id="box" class="active"></div>
const element = document.querySelector("#box"); // Check if hasclass // Result is a boolean element.classList.contains("active");
true