You can use the jQuery toggleClass function to do this:
$(" ... ").click(function() { $(this).toggleClass("someClass"); });
When you click once, the element has the class someClass , and when you double-click, the class is deleted again.
source share