Never Write hasClass Again Jun 27th, 2013 1 $('.navigation').hasClass('collapsed'); The code above can be easily refactored into the both shorter and easier to read: 1 $('.navigation').is('.collapsed');