check if class list contains javascript code example Example: if classlist contains js element.classList.contains(class);