jQuery onclick toggle class name
<p>Using jQuery, how do I toggle classA to classB on click going from:</p>

<pre><code>&lt;a class="switch" href="#"&gt;Switch&lt;/a&gt;
&lt;div class="classA"&gt;&lt;/div&gt;


$('.switch').on('click', function(e){
    $('.classA').removeClass('classA').addClass('classB');
    e.preventDefault();
};
</code></pre>

<p>How do I toggle the class, instead of just replacing it like I'm doing here?</p>
