I assign new id to a button. this is my code
$("#update").click(function(){
$("#update").attr('id', 'cancel');
});
and i after changing the id. i want to use it to be functional again in jquery to revert it back to update. having this code.
$("#cancel").click(function(){
$("#cancel").attr('id', 'update');
});
my problem is, after it changed the id attribute when i click the cancel nothing happens. what is the problem of my code.? thank you in advance.