Switching class between two elements using jQuery
<p>I have two elements with a class name each. And on some event I'd like them to switch class.<br>
So basically I'd like to do something like this:</p>

<pre><code>$("#div1").switchClassWith("#div2");

&lt;div id="div1" class="someStylingClass"&gt;...content...&lt;/div&gt;
&lt;div id="div2" class="someOtherClass"&gt;...content...&lt;/div&gt;
</code></pre>

<p>And this would result in <code>#div1</code> having <code>someOtherClass</code> as its class name, and <code>#div2</code> have <code>someStylingClass</code>... Any suggestions?</p>
