check for a class in a page using js code example Example: how to check has class name in js? element.classList.contains(className);Code language: CSS (css)