title: IE6 and addClass() in Jquery
body: <p>This doesn't seem to work in Jquery</p>
  
  <pre><code>$(document).ready(function() {
  
      $(".navlist li").each(function() {
          var href = $(this).find("a").attr("href");
  
  
          if ($(this).find("a").attr("href") == window.location.pathname) {
             $(this).attr("class", "active"); 
          }
      });
  
  });
  </code></pre>
  
  <p>in my html</p>
  
  <pre><code>&lt;div id="main-navigation"&gt;
                  &lt;ul class="navlist"&gt;   
                      &lt;li&gt;&lt;a href="&lt;%=ResolveUrl("~/home.aspx")%&gt;"&gt;home&lt;/a&gt;&lt;/li&gt;                 
                      &lt;li&gt;&lt;a href="&lt;%=ResolveUrl("~/sample-templates/view-list.aspx")%&gt;"&gt;manage sample templates&lt;/a&gt;&lt;/li&gt;
                      &lt;li&gt;&lt;a href="&lt;%=ResolveUrl("~/fractional-templates/manage.aspx")%&gt;"&gt;manage fractional templates&lt;/a&gt;&lt;/li&gt;
                      &lt;li&gt;&lt;a href="&lt;%=ResolveUrl("~/faq.aspx")%&gt;"&gt;faq&lt;/a&gt;&lt;/li&gt;
                  &lt;/ul&gt;
              &lt;/div&gt;  
  </code></pre>
  
  <p>in my css</p>
  
  <pre><code>.navlist li.active a
  {
      color: #fff;
      background-color: #369;
      text-decoration: none;  
  }
  </code></pre>
  
  <p>Any suggestions?</p>
  
  <p>I debugged the js and the problem is that the class is not being added</p>