I'm having a problem with adding the class "active" to my first anchor in my nav (Home).
Here is my codepen - http://codepen.io/Kuzyo/pen/vbhDF
Here's my jQuery:
$(document).ready(function() {
var homeLink = $(".nav a")[0];
console.log(homeLink);
homeLink.addClass("active");
$("#home").addClass("center");
});
Here's the (relevant to the question part of) my HTML:
<div class="header">
<div class="holder clearfix">
<ul class="nav">
<li><a href="#home">Home</a></li>
<li><a href="#about">About</a></li>
<li><a href="#creature">Creature</a></li>
<li><a href="#landscape">Landscape</a></li>
<li><a href="#contact">Contact</a></li>
</ul>
</div>
</div>
Can anyone see what I'm doing wrong?