Switching classes when clicked for a div in jQuery?
<p>Basically, I have a div block whose class I want replaced on click.</p>

<p>My HTML:</p>

<pre><code>&lt;div class="lol"&gt;       
&lt;/div&gt;
</code></pre>

<p>My jQuery code:</p>

<pre><code>$('.lol').toggleClass('troll');
</code></pre>

<p>This outputs:</p>

<pre><code>&lt;div class="lol troll"&gt;
&lt;/div&gt;
</code></pre>

<p><strong>How do I completely replace the class name lol with troll?</strong></p>
