Jquery add and remove class on a menu
<p>I'm newbie in jquery, I have this html code menu:</p>

<pre><code>&lt;nav&gt;
    &lt;ul class="navtab"&gt;
        &lt;li class='home selected'&gt;&lt;a href='index.php'&gt;Home&lt;/a&gt;&lt;/li&gt;
        &lt;li class='about'&gt;&lt;a href='company.php'&gt;About&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
&lt;/nav&gt;
</code></pre>

<p>this is jquery code:</p>

<pre><code>$(".navtab li.about").click(function(){
    $('.navtab li.home').removeClass('selected');
    $('.navtab li.about').addClass('selected');
});
</code></pre>

<p>and this my css:</p>

<pre><code>nav ul.navtab li.selected a{
    color: #fff;
    background-color: #575757;
}
</code></pre>

<p>When the page load tab home is selected. When I click on about tab I want to remove class selected on tab home and add class selected on tab about. Where is the problem??</p>

<p>Thanks in advance. Fabio</p>
