Say, you have a set of links (tabs), and onclick you want to highlight one and default the rest.
$('.nav a').click(function(){
$(this).siblings().each(function(){
$(this).removeClass("hi");
});
$(this).addClass("hi");
});
Couldn't be any easier now, could it? Love the each() iterator function. sweet.
No comments:
Post a Comment