jquery menu - active links
<p>I am trying to make a jquery menu that when I click on one of the links (with reloading the page), it changes its class to "active" and removes this class when I click on another link.</p>

<p>here is my code :</p>

<p>enter code here`$(document).ready(function(){</p>

<pre><code>$(function(){
  $("a").click(function(){
    $(this).parent().addClass('inny').siblings().removeClass('inny');
  });
});
});




 &lt;ul id="mainMenu"&gt;
        &lt;li class="hover-width1"&gt;&lt;a href="d.html"&gt;STRONA GŁÓWNA&lt;/a&gt;&lt;/li&gt;
        &lt;li class="hover-width3"&gt;&lt;a href="glowna.html"&gt;OFERTA&lt;/a&gt;&lt;/li&gt;
        &lt;li class="hover-width3"&gt;&lt;a href="d2.html"&gt;CENNIK&lt;/a&gt;&lt;/li&gt;
        &lt;li class="hover-width2"&gt;&lt;a href="tom.html"&gt;PRZEPISY&lt;/a&gt;&lt;/li&gt;
        &lt;li class="hover-width2"&gt;&lt;a href="jan.html"&gt;GALERIA&lt;/a&gt;&lt;/li&gt;
        &lt;li class="hover-width1"&gt;&lt;a href="#"&gt;NASI KLIENCI&lt;/a&gt;&lt;/li&gt;
        &lt;li class="hover-width2"&gt;&lt;a href="#"&gt;NARZĘDZIA&lt;/a&gt;&lt;/li&gt;
        &lt;li class="hover-width1"&gt;&lt;a href="#"&gt;CIEKAWOSTKI&lt;/a&gt;&lt;/li&gt;
        &lt;li class="hover-width2"&gt;&lt;a href="#"&gt;KONTAKT&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
</code></pre>

<p>Can someone tell me why my code is not working when I reload the page:(</p>
