I want to disable onclick event after successful ajax request
<div class="report_button" id="report_button" title="Reportthis" style="width:65px;height:15px;" onclick="reported_text(user_id,lead_id);">Report</div>
this is my div which i want to disable div after clicked
function reported_text(user_id,lead_id){
new Ajax.Request("/agent/report/lead-refund",
{
method:"POST",
parameters:"user_id=" + user_id + "&lead_id=" + lead_id ,
onSuccess: function(transport){
alert("Thank you for Response");
jQuery('#report_button').attr("disabled", "disabled");
},
onFailure: function(transport){
$('tag_error_status').innerHTML = '';
alert("Unsuccessful request processing. This will be rectified soon.");
}
});
}
is there any way to do this. and this div is used for many users, i have to do it in such a way so that it only disable for particular user.