check if active class exists javascript code example
Example 1: js check for class in classList
element.classList.contains(className);
Example 2: check if class is active jquery
$('li.menu').hasClass('active');
element.classList.contains(className);
$('li.menu').hasClass('active');