remove all other classes on click and add to this?
Hi,
I've used the following code:
mAjQ(document).ready(function(){pplr();});
function pplr(){mAjQ("a[href$='mp3']").live("click",function(){
if(!mAjQ(this).hasClass("mAa")){
mAjQ(this).addClass("mAa").after("SOMETHING");
}
else{
mAjQ(this).next().remove();mAjQ(this).removeClass("mAa").next().remove();
}
return false;
});}
This code add a class on click on element and remove the same class if this element already has class.
How to remove class if I click on another element and at the same time add class to this another element
Is it possible? I would appreciate any help.
Many thanks