title: How To Highlight Show Active Tab In A Navbar-Fixed-Top
body: <p>I am current changing a website to use Bootstrap and I have been advised that they want to use the <code>navbar-inverse navbar-fixed-top</code> main menu.</p>
  
  <p>The thing is I can't figure out how to highlight the selected page and keep it highlighted.</p>
  
  <p>I have tried the follow Jquery but I cant get none of them working</p>
  
  <pre><code> $(function() {
      $('#nav li a').click(function() {
         $('#nav li').removeClass();
         $($(this).attr('href')).addClass('active');
      });
   });
  </code></pre>
  
  <p>My HTML for my menu is:</p>
  
  <pre><code>    &lt;div class="navbar navbar-inverse navbar-fixed-top"&gt;
          &lt;div class="container"&gt;
              &lt;div class="navbar-header"&gt;
                  &lt;button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"&gt;
                      &lt;span class="icon-bar"&gt;&lt;/span&gt;
                      &lt;span class="icon-bar"&gt;&lt;/span&gt;
                      &lt;span class="icon-bar"&gt;&lt;/span&gt;
                  &lt;/button&gt;
                  &lt;a class="navbar-brand" runat="server" href="~/"&gt;Logo Here&lt;/a&gt;
              &lt;/div&gt;
              &lt;div class="navbar-collapse collapse"&gt;
                  &lt;ul class="nav navbar-nav"&gt;
                      &lt;li&gt;&lt;a runat="server" href="~/"&gt;&lt;span class="glyphicon glyphicon-home"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
                      &lt;li style="border-left: 1px solid lightgray"&gt;&lt;a runat="server" href="~/About"&gt;About&lt;/a&gt;&lt;/li&gt;
                      &lt;li style="border-left: 1px solid lightgray"&gt;&lt;a runat="server" href="~/Session/pg1"&gt;Session&lt;/a&gt;&lt;/li&gt;
                      &lt;li style="border-left: 1px solid lightgray"&gt;&lt;a runat="server" href="~/EmailPg"&gt;Email&lt;/a&gt;&lt;/li&gt;
                  &lt;/ul&gt;
                  &lt;asp:LoginView runat="server" ViewStateMode="Disabled"&gt;
                      &lt;AnonymousTemplate&gt;
                          &lt;ul class="nav navbar-nav navbar-right"&gt;
                              &lt;li&gt;&lt;a runat="server" href="~/Contact"&gt;Contact us&lt;/a&gt;&lt;/li&gt;
                          &lt;/ul&gt;
                      &lt;/AnonymousTemplate&gt;
                  &lt;/asp:LoginView&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>I would prefer if its possible to do it with CSS or Jquery but I was also a little confused as, do I add the Jquery to every page OR can I add one lot to my Site.Master file</p>