 <p>you can add class active to your home link in your html, you don't need javascript to handle this.</p> <pre><code> &lt;li&gt;&lt;a href="#Home" class="scroll active"&gt;Home&lt;/a&gt;&lt;/li&gt; //-^^^^^^--here </code></pre> <p>well if incase you want then you can use eq..</p> <pre><code>$('.scroll:eq(0)').addClass('active'); </code></pre> <p>inside your document.ready function</p> <p><a href="http://jsfiddle.net/SZ63C/2/" rel="nofollow">fiddle here</a></p>