title: jQuery addClass not working?
body: <p>I'm trying to build a website but I keep getting the same problem.</p>
  
  <p>Once the page loads, I want to add a class to the menu item (active) so it looks selected. This is the code I use (it's located just before the closing body tag).</p>
  
  <pre><code>$(document).ready(function(){
      $('#navList li a#navHome').addClass('active');
  });
  </code></pre>
  
  <p>The HTML is like this:</p>
  
  <pre><code>&lt;ul id="navList"&gt;
      &lt;li&gt;&lt;a href="index.php" title="Home" id="navHome"&gt;home&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>However, when I inspect the element, no class gets added. I really can't find out what I'm doing wrong?</p>
  
  <p>The jQuery file is linked correctly because other jQuery code works.</p>