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