toggleClass()
<!DOCTYPE html> <html> <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script> <style type="text/css"> .highlight { background: yellow; } </style> <script> $(function(){ $("#div").on("click", function(){ $(this).toggleClass("highlight"); }); }); </script> <body> <div id="div">HELLO</div> </body> </html>