Element has class [browser] Check if DOM element has a class. Install npm install kc-hasclass Use var el = document.querySelector('#my-elem'); var cls = 'dummy'; // Class name var has = hasclass(el, cls); console.log(has);