I have JQuery script similar to this:
$('.follow_link').click(function(){
// Do some stuff
$(this).removeClass();
$(this).addClass("unfollow_link");
});
$('.unfollow_link').click(function(){
// Do some stuff
$(this).removeClass();
$(this).addClass("follow_link");
});
My problem is that after I change the class the link is still refering to it's old class' click event. Is there a way of rebinding? Or am I doing this a bad way?