title: Adding active class to link via jQuery
body: <p>I am quite new here and to jQuery but I have searched the related questions in stackoverflow but none is solving my problem. I have this code:</p>
  
  <p>Html:</p>
  
  <pre><code>&lt;div class="menu"&gt;
      &lt;div class="menu-items"&gt;
         &lt;ul class="nav"&gt;
           &lt;li class="var_nav"&gt;
              &lt;a href="../home.php"&gt;Home&lt;/a&gt;
           &lt;/li&gt;
           &lt;li class="var_nav"&gt;
              &lt;a href="../portfolio.php"&gt;Porfolio&lt;/a&gt;
           &lt;/li&gt;
           &lt;li class="var_nav"&gt;
              &lt;a href="../dashboard.php"&gt;Dashboard&lt;/a&gt;
           &lt;/li&gt;
           &lt;li class="var_nav"&gt;
              &lt;a href="../users.php"&gt;Users&lt;/a&gt;
           &lt;/li&gt;
         &lt;/ul&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>CSS</p>
  
  <pre><code>.nav li.active {
      background-color: #048abb;
  }
  .nav li.active a {
      color: #fff;
  }
  </code></pre>
  
  <p>I want to apply class .active to the clicked(current/active) link so that the css can take effect. Any suggestions on how to apply the class to obove html code via jQuery?</p>