title: jQuery add class .active on menu
body: <p>I've got a problem.</p>
  
  <p>I want to add the class "active" on item menu when the relative page is on.</p>
  
  <p>the menu is very simple:</p>
  
  <pre><code>&lt;div class="menu"&gt;
  
  &lt;ul&gt;
  &lt;li&gt;&lt;a href="~/link1/"&gt;LINK 1&lt;/a&gt;
  &lt;li&gt;&lt;a href="~/link2/"&gt;LINK 2&lt;/a&gt;
  &lt;li&gt;&lt;a href="~/link3/"&gt;LINK 3&lt;/a&gt;
  &lt;/ul&gt;
  
  &lt;/div&gt;
  </code></pre>
  
  <p>In jQuery I need to check if the url is www.xyz.com/other/link1/</p>
  
  <p>if it's this one I would like to add a class one the 'a' element of link1.</p>
  
  <p>I'm trying many solutions but nothing work.</p>