Unbind class selector jquery after changing class of a div
I am dynamically altering the class of a div when ajax request completes. <div id="MyDiv1" class="oldclass">Age</div> Inside the success function of ajax request : $('.oldclass').click({ alert('I am old'); }); $('.youngclass').click({ alert('I am young'); }); $.ajax({ ........ success: function(){ $('#MyDiv1').removeAttr('oldclass'); $('#MyDiv1').addAttr('youngclass');…