Toggle multiple element classes with jQuery
If the elements to be toggled start off with one of the two classes, you can then toggle back and forth like this:
$('#element_to_click').click( function(){ $('.togToo').toggleClass('classC classD');});
Answer Updated
$(".main").click(function() { $(this).toggleClass("classA").toggleClass("classB"); $('.togToo').toggleClass("classC").toggleClass("classD");})