title: css class active after page reload
body: <p>i'm having some trouble.
  I'm doing an asp.net mvc3 application and i downloaded some css menu, the thing is i want to keep the menu active after menu tab its clicked and only change when another one is clicked.</p>
  
  <p>here's the code of the menu on _Layout.cshtml</p>
  
  <pre><code>&lt;nav&gt;
  &lt;div class="cssmenu"&gt;
                  &lt;ul&gt;
                      &lt;li class='active'&gt;&lt;span&gt;@Html.ActionLink("Início", "Index", "Home")&lt;/span&gt;&lt;/li&gt;
                      &lt;li&gt;&lt;span&gt;@Html.ActionLink("Tarefas Contabilidade", "SelectEmpresa", "Empresa")&lt;/span&gt;&lt;/li&gt;
                      &lt;li&gt;&lt;a href='#'&gt;&lt;span&gt;Clientes&lt;/span&gt;&lt;/a&gt;
                          &lt;ul&gt;
                              &lt;li&gt;&lt;span&gt;@Html.ActionLink("Listar clientes", "ListarEmpresas", "Empresa")&lt;/span&gt;&lt;/li&gt;
                             &lt;/ul&gt;
                      &lt;/li&gt;
                       &lt;li&gt;&lt;a href='#'&gt;&lt;span&gt;Balancetes&lt;/span&gt;&lt;/a&gt;
                          &lt;ul&gt;
                              &lt;li&gt;&lt;span&gt;@Html.ActionLink("Listar registos", "ListaBalancetesPorSalaoMes", "Balancete")&lt;/span&gt;&lt;/li&gt;
                          &lt;/ul&gt;
                      &lt;/li&gt;
                      &lt;li&gt;&lt;span&gt;@Html.ActionLink("Sobre", "About", "Home")&lt;/span&gt;&lt;/li&gt;
  &lt;/ul&gt;
   &lt;/div&gt;
          &lt;/nav&gt;
  </code></pre>
  
  <p>and i have this script:</p>
  
  <pre><code> &lt;script type="text/javascript"&gt;
  
                      $("li").click(function () {
                          $("li").removeClass("active");
                          $(this).addClass("active");
  
                      });
  &lt;/script&gt;
  </code></pre>
  
  <p>the first tab that i put there class= "active" works, but the script doesn't seem to work when i click another menu tab, it only shows the first one active
  a little help please :)</p>
  
  <p><strong>UPDATED</strong></p>
  
  <p>This is the rendered html:</p>
  
  <pre><code>           &lt;nav&gt;
  
             &lt;div class="cssmenu"&gt;
  
                  &lt;ul&gt;
  
                      &lt;li&gt;&lt;span&gt;&lt;a href="/"&gt;In&amp;#237;cio&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
  
                      &lt;li&gt;&lt;span&gt;&lt;a href="/Empresa/SelectEmpresa"&gt;Tarefas Contabilidade&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
  
                      &lt;li&gt;&lt;a href='#'&gt;&lt;span&gt;Clientes&lt;/span&gt;&lt;/a&gt;
  
                          &lt;ul&gt;
  
                              &lt;li&gt;&lt;span&gt;&lt;a href="/Empresa/ListarEmpresas"&gt;Listar clientes&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
  
                              &lt;li&gt;&lt;span&gt;&lt;a href="/Salao/ListaSalaoByEmpresa"&gt;Listar sal&amp;#245;es&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
  
                               &lt;li&gt;&lt;span&gt;&lt;a href="/Salao/ListaEmpregadosBySalao"&gt;Gerir empregados&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;                           
  
                              &lt;li&gt;&lt;span&gt;&lt;a href="/Empresa/Create"&gt;Novo cliente&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
  
                              &lt;li&gt;&lt;span&gt;&lt;a href="/Salao/Create"&gt;Novo sal&amp;#227;o&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;   
  
                             &lt;/ul&gt;
  
                      &lt;/li&gt;
  
                       &lt;li&gt;&lt;a href='#'&gt;&lt;span&gt;Balancetes&lt;/span&gt;&lt;/a&gt;
  
                          &lt;ul&gt;
  
                              &lt;li&gt;&lt;span&gt;&lt;a href="/Balancete/ListaBalancetesPorSalaoMes"&gt;Listar registos&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
  
                              &lt;li&gt;&lt;span&gt;&lt;a href="/Balancete/UploadFile"&gt;Upload novo balancete&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
  
                              &lt;li&gt;&lt;span&gt;&lt;a href="/Balancete/GraficoBalancetePorSalao"&gt;Mapa Resultados/Gr&amp;#225;fico&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
  
                              &lt;li&gt;&lt;span&gt;&lt;a href="/Balancete/MapaEstruturaRendimentoseGastos"&gt;Mapas Contabilidade/Gest&amp;#227;o&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
  
                              &lt;li&gt;&lt;span&gt;&lt;a href="/Balancete/MapasGestao"&gt;An&amp;#225;lise Rentabilidade&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
  
                              &lt;li&gt;&lt;span&gt;&lt;a href="/Balancete/alteraTaxas"&gt;Alterar taxas&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
  
                          &lt;/ul&gt;
  
                      &lt;/li&gt;
  
                      &lt;li&gt;&lt;span&gt;&lt;a href="/Home/About"&gt;Sobre&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
  
  
  
  
  
  
  
                  &lt;/ul&gt;
  
  
  
  
  
  
  
              &lt;/div&gt;
  
  
  
  &lt;/nav&gt;
  </code></pre>
  
  <p>i dont know if i should put the javascript inside the div or something xD</p>
  
  <p>Ty</p>