So what I want to do is determine if the current link is \'active\', i.e. if this link was just clicked by the user.
If it is, then I want to apply the class=s
jQuery like this should work for you
$(function(){
$("a").click(function(){
$("a").removeClass("selected")
$(this).addClass("selected")
return false;
})
})
If you want this to work for a very specific set of links that add more to the selectors.
For example let's say the ul has an id header
then your jQuery should look like
$(function(){
$("#header a").click(function(){
$("#header a").removeClass("selected")
$(this).addClass("selected")
return false;
})
})