On 26 Giu, 07:47, hubbs <[EMAIL PROTECTED]> wrote: > I have a list of links, and when one is clicked, I would like a class > to be added. I understand how to do this, but when you click another > link, I would like the class removed from the first click and added to > the second click, and so on, so that there is always only one link > with the class applied.
this should do the trick:
var $a = $('a');
$a.click(function(){
$a.removeClass('myClass');
$(this).addClass('myClass');
});
:)

