title: Setting bootstrap navbar active element using jquery
body: <p>In my Navbar I have:</p>
  
  <pre><code>&lt;ul class="nav" &gt;            
            &lt;li class="active"&gt;&lt;?php echo anchor('b/home', 'Home') ?&gt;&lt;/li&gt;
            &lt;li&gt;&lt;?php echo anchor('buyers/info', 'Information') ?&gt;&lt;/li&gt;
  </code></pre>
  
  <p>I want to set the class active depending on the page I'm on. I have passed in the name of the inner html as a variable called 'nav'. To this I want to select "The 'li' element where the contained 'a' element's inner HTML= value of 'nav' "</p>
  
  <p>I'm not experienced at jquery. I've tried the following, but it does not work:</p>
  
  <pre><code>$("li [a[html()=nav]]").addClass('active'); 
  </code></pre>
  
  <p>Could someone give me a hand in fixing this?</p>