js .toggleClass('is-expanded'); code example Example: jquery toggle class $( "#foo" ).toggleClass( 'className', addOrRemoveOptional );