jquery toggle class same button code example Example: jquery toggle class $( "#foo" ).toggleClass( 'className', addOrRemoveOptional );