Using jQuery I am trying to set focus for (CSS purposes) to a particular link from a list of related links on the load of the page based upon the class name.
Example, of the following I want to set focus to Link1
<a href="#Link1" class="nav-button-left">Link1</a>
<a href="#Link2" class="nav-button">Link2</a>
<a href="#Link3" class="nav-button">Link3</a>
<a href="#Link4" class="nav-button">Link4</a>
<a href="#Link5" class="nav-button">Link5</a>
<a href="#Link6" class="nav-button-right">Link6</a>
Currently this is the code snippet I have working so far, and by working I mean I've set it up, it does nothing noticeable so far.
<script type="text/JavaScript">
$(window).load(function(){
if($(this).attr("class") == 'nav-button-left'){$(".nav-button-left").focus();}
})
</script>
I'm fairly sure its the actual focus portion that's not working, although I can't fathom.