How do I add and remove classes with jQuery?
<p>I have ul list with a link in each li. My question is: how do I remove the class 'selected' from one a (anchor) and apply it to the one I hover over?</p>

<pre><code>&lt;ul&gt;
&lt;li&gt;&lt;a href="" class="selected"&gt;Link 1&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=""&gt;Link 2&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=""&gt;Link 3&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=""&gt;Link 4&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=""&gt;Link 5&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</code></pre>
