title: Jquery switch on and off class on click
body: <p>I am trying to work out, on click function remove class <code>on</code> and add new class <code>off</code>. when I click on the div again I would like to add class <code>on</code> again and remove class <code>off</code> which is not happening. I am not sure what reason this is not working. But if alert it works.
  Here is my code. and <a href="http://jsfiddle.net/LEvM4/" rel="nofollow">Jsfiddle demo</a></p>
  
  <pre><code>$(".on").bind('click',function() {
      $(this).removeClass('on').addClass('off');
      alert('Hello World');
  })
  $(".off").bind('click',function() {
      $(this).removeclass('off').addClass('on');
    alert('Hello World');
  })
  ​
  </code></pre>