I have 4 anchors, I want to add a class of current to an anchor as it is clicked and remove the class from the other 3 at the same time. Here\'s my code. what am I doing wro
I think this will help you
$("a").click(function() { $('a').removeClass('current'); var id = $(this).attr('id'); $('#'+id).addClass('current'); });