title: Looking at href values of children
body: <p>How do I look at the child values of an href within a parent ID and check to see if it matches the current URL?  Then, apply a class to the parent and a class to the matching child element.</p>
  
  <pre><code>&lt;!-- notice the ID on the li - "aboutsection" --&gt;
  &lt;ul id="mainnav" class="nav navbar-nav"&gt;
  
   &lt;!-- About --&gt;
  
  
              &lt;li class="dropdown jsb-fw" id="aboutsection"&gt;&lt;a href="#" 
  
  data-hover="dropdown" data-delay="100" data-close-others="false" 
  
  class="dropdown-toggle"&gt;About&lt;/a&gt;
                &lt;ul class="dropdown-menu"&gt;
  
                   &lt;li class="grid-output"&gt;
  
                     &lt;div class="row"&gt;
  
                  &lt;div class="col-sm-3 about"&gt;
  
                      &lt;h3 class="menuHeading"&gt;About US&lt;/h3&gt;   
                      &lt;ul&gt;    
                         &lt;li&gt;&lt;a 
  
  href="http://localhost:8500/mysite/pagetestcurrent.cfm"&gt;Link to this page &lt;/a&gt;&lt;/li&gt;
                         &lt;li&gt;&lt;a 
  
  href="http://localhost:8500/mysite/anotherpage.cfm"&gt; Link to another page &lt;/a&gt;&lt;/li&gt;
  
                     &lt;/ul&gt;
              &lt;/div&gt;
             &lt;/div&gt;
               &lt;/li&gt;
             &lt;/ul&gt;
          &lt;/li&gt;   
  
    &lt;/ul&gt;
  
  &lt;!-- if we are on any of the pages in the dropdown menu (which would 
  
  be either'pagetestcurrent' or 'anotherpage' as in the example above as 
  
  children of the about section), put a currentTab class on the above li 
  
  with the ID 'aboutsection'--&gt;
  </code></pre>
  
  <p>jQuery that adds the class to the id 'aboutsection'.  Currently adds the class regardless of the href values in the children.</p>
  
  <pre><code>&lt;script&gt;
  $('#aboutsection a').filter(function(){
      return this.href = window.location.href;
  }).parent().addClass('currentTab');
  &lt;/script&gt;
  </code></pre>