title: jquery Current Nav item selector
body: <p>I can't figure out how to use jQuery to style the current nav item. I've tried several tutorials and such to no avail. Any help would be appreciated.
  Thanks in advance.</p>
  
  <pre><code>    &lt;div id="menu"&gt;
       &lt;ul id="nav"&gt;  
        &lt;li&gt;&lt;a href="http://poolguys.jaredmc.com/index.php"&gt;Contact&lt;/a&gt;&lt;/li&gt; 
        &lt;li&gt;&lt;a href="http://poolguys.jaredmc.com/index.php"&gt;Gallery&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="http://poolguys.jaredmc.com/pool_liners.php"&gt;Pool Liners&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="http://poolguys.jaredmc.com/services.php"&gt;Services&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="http://poolguys.jaredmc.com/about.php"&gt;About&lt;/a&gt;&lt;/li&gt; 
        &lt;li&gt;&lt;a href="http://poolguys.jaredmc.com/index.php"&gt;Home&lt;/a&gt;&lt;/li&gt; 
      &lt;/ul&gt;&lt;!--end nav--&gt;         
    &lt;/div&gt;&lt;!--end menu--&gt; 
  
     /** nav styling **/
  
     //&lt;![CDATA[
      jQuery(function() {
       jQuery('#nav li').each(function() {
        var href = jQuery(this).find('a').attr('href');
        if (href === window.location.pathname) {
        jQuery(this).addClass('current');
         }
        });
      });  
    //]]&gt;
  </code></pre>