how to check if a button has an active class on page javascript code example Example: check if class is active jquery $('li.menu').hasClass('active');