title: how to add class to list item
body: <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code> 
  jQuery(function($) {
      var path = window.location.href; 
      $('ul li').each(function() {
          if (this.href === path) {
              $(this).addClass('active');
          }
      });
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;ul id="nav" class="nav navbar-nav"&gt;
      &lt;li class="active"&gt;&lt;a href="a.php"&gt;A&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="b.php"&gt;Bs&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="c.php"&gt;C  &lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt; </code></pre>
  </div>
  </div>
  </p>
  
  <p>I want to change the class="active" in list items on click.</p>