Unable to replace the class of div element - no method named css
<p>I want to replace the old class of html element with the new one using jQuery. Here is what I'm doing:</p>

<pre><code>var elem = $('.my_selector')[0];
elem.css('class', 'my_new_class');
</code></pre>

<p>But I get the error saying "Uncaught type error: <code>Object#&lt;HtmlDivElement&gt; has no method css</code>. </p>

<p>How do I fix it?</p>
