title: How can i disable onclick event after successful ajax request?
body: <p>I want to disable onclick event after successful ajax request</p>
  
  <pre><code>&lt;div class="report_button" id="report_button" title="Reportthis" style="width:65px;height:15px;" onclick="reported_text(user_id,lead_id);"&gt;Report&lt;/div&gt;
  </code></pre>
  
  <p>this is my div which i want to disable div after clicked </p>
  
  <pre><code>function reported_text(user_id,lead_id){
      new Ajax.Request("/agent/report/lead-refund",
      {
          method:"POST",
          parameters:"user_id=" + user_id + "&amp;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.");
          }
      });
  }
  </code></pre>
  
  <p>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.</p>