title: jquery invert class attribute on click
body: <p>With this simple markup:</p>
  
  <pre><code>&lt;a id="foo" class="first" href="#"&gt;&lt;/a&gt;
  </code></pre>
  
  <p>I wish to obtain something like this:</p>
  
  <pre><code>$('#foo').click (function () { 
      if $('foo').hasClass('first') { $('foo').removeClass('first').addClass('second');
  
      if $('foo').hasClass('second') { $('foo').removeClass('second').addClass('first'); 
  });
  </code></pre>
  
  <p>I don't know before which class has the element, if "first" or "second". 
  How is it possible to do this every time I click on the element, refreshing the reading of the class?</p>
  
  <p>I wish I was clear.</p>
  
  <p>Any help would be apreciated.</p>
  
  <p>Thanks in advance.</p>