title: jQuery add and remove class dynamically on link click
body: <p>I tried to add and remove a class on an HTML element using jQuery. It successfully adds the class, but the page link in my navbar didn't take me to the related page. How to solve this problem? Here is my <a href="http://jsfiddle.net/aqeelpld/7yydg1nt/" rel="nofollow">Fiddle</a> and script:</p>
  
  <pre><code>$('li a').click(function(e) {
      e.preventDefault();
      $('a').removeClass('active');
      $(this).addClass('active');
  });
  </code></pre>