title: toggleClass (add if not present)
body: <p>What is the simplest way to toggle a class if it is present, otherwise adding one if it's not?</p>
  
  <p>Currently I'm using:</p>
  
  <pre><code>if ($(e.target).hasClass('clicked-odd')) {
    $(e.target).removeClass('clicked-odd');
    $(e.target).addClass('clicked-even');
  } else {
    $(e.target).removeClass('clicked-even');
    $(e.target).addClass('clicked-odd');
  }
  </code></pre>
  
  <p>... which seems a bit long.</p>
  
  <p>You'd think this would work:</p>
  
  <pre><code>$(e.target).toggleClass('clicked-even', 'clicked-odd')      
  </code></pre>
  
  <p>But it seems to only switch a class if it's present, but doesn't add 'clicked-odd' if neither class is present.</p>