remove class if button is clicked a second time jquery code example Example: jquery toggle class $( "#foo" ).toggleClass( 'className', addOrRemoveOptional );