title: How to Active nav bar in bootstrap with jquery
body: <p>I want make the navbar active when i click it,,</p>
  
  <p>Here is the jquery i use </p>
  
  <pre><code>$(document).ready(function () {
          $('.navbar li').click(function(e) {
              $('.navbar li').removeClass('active');
              var $this = $(this);
              if (!$this.hasClass('active')) {
                  $this.addClass('active');
              }
          e.preventDefault();
          });         
      });
  </code></pre>
  
  <p>But because the <code>preventDefault</code> i can't go to the link that i want. It just make the navbar active, but it's not go to the link that i choose.</p>
  
  <p>And here is the link code :</p>
  
  <pre><code>&lt;div class="nav-collapse collapse"&gt;
      &lt;ul class="nav"&gt;
          &lt;li&gt;&lt;a href='&lt;?php echo site_url(' tampilan ') ?&gt;'&gt;Knowledge Base&lt;/a&gt;
          &lt;/li&gt;
          &lt;li&gt;&lt;a href='&lt;?php echo site_url(' ticketing/browse_ticketing ') ?&gt;'&gt;Ticketing&lt;/a&gt;
          &lt;/li&gt;
          &lt;li&gt;&lt;a href='&lt;?php echo site_url(' user/logout ') ?&gt;'&gt;Logout&lt;/a&gt;
          &lt;/li&gt;
      &lt;/ul&gt;
  &lt;/div&gt; 
  </code></pre>
  
  <p>if i dont use <code>preventDefault()</code> the navbar won't active, but if i use it i can't go to the link i want..</p>