Using jQuery, how do I toggle classA to classB on click going from:
<a class="switch" href="#">Switch</a>
<div class="classA"></div>
$('.switch').on('click', function(e){
$('.classA').removeClass('classA').addClass('classB');
e.preventDefault();
};
How do I toggle the class, instead of just replacing it like I'm doing here?