I am having problem with addClass() and removeClass() function in jquery. When i use the function it was replace the classes. but it was not calling the addded class functions. here is my query
HTML Code :
<div class="animation1 popbutton">Click Me</div>
Jquery :
$(".animation1").click(function(){ 
   // my first function 
 });
$(".animation2").click(function(){ 
   // my second function 
 });
and my add and remove class functions are,
$.ajax({
    url : 'file.php',
    data : postdata,
    type : 'post',
    success : function (saveresponseText)
    {
        $(".animation1").removeClass("animation1").addClass("animation2").html("Clicked");
    } 
});
if click the animation1 it will call the ajax function and it will replace the classname as animation2 and it has some separate function. how can do this? Someone suggest a solution please.
Thanks in Advance,
 
     
     
     
     
    