I am using jQuery bind on bunch of radio buttons with the following code:
jQuery().ready(function() {
jQuery("input[name='rank_number']:radio").bind('change', function(){
submitSelectedRank();
});
});
This code is working fine on initial load of the page but the HTML for these radio buttons can be reloaded via an Ajax call using:
$.ajax({
type: "POST",
url: "/loadMyRadioButtons",
data: rankings,
dataType: "html",
success: function(response)
{
$('#radioBtnDiv').html(response);
}
});
Now the issue, anytime this ajax call replaces the HTML code, the binding stops working. How do I fix that?