const element = document.querySelector("#box");
element.classList.contains("active");
var isMobileVersion = document.getElementsByClassName('snake--mobile');
if (isMobileVersion.length > 0) {
// elements with class "snake--mobile" exist
}
const div = document.querySelector('.info');
div.classList.contains('secondary'); // trueCode language: JavaScript (javascript)
<div class="secondary info">Item</div>Code language: HTML, XML (xml)