Jquery - How to find a #tag a name and apply a class
<p>When on #page1 of a website I'd like the menu item for #page1 to be highlighted like a current page style. I've tried add a class and applying css directly with the code below, neither works.</p>

<p>Can anyone tell me what I'm doing wrong? THANKS in advance.</p>

<pre><code>var url = window.location.href;
if (url.search("#page1") &gt; 0) {
$("#mainNav ul li a.scroll1").addClass("current");
$("#mainNav ul li a.scroll1").css("color","#000");
} 
</code></pre>
