if li has the class of active javascript code example Example: check if class is active jquery $('li.menu').hasClass('active');