title: How to apply same Jquery function to multiple button
body: <p>I am trying to get data from my database using Ajax. What I want to do is add a delete button after every data row, so that if I want to delete a particular row i just click the delete button in front of it. How do i do that? I am presently trying to use both Jquery and javascript..</p>
  
  <pre><code>&lt;table&gt;
  &lt;tr&gt;&lt;td&gt; A &lt;/td&gt; &lt;td&gt; &lt;input type = 'button' onclick = 'delete(A)' value = 'Delete'&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt; B &lt;/td&gt; &lt;td&gt; &lt;input type = 'button' onclick = 'delete(B)' value = 'Delete'&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;/table&gt;
  
  &lt;script type="text/javascript"&gt;
  $(document).ready(function() {
  function delete(d) {
      var deletedata = 'delete=' + d;
      $.post('searchadd.php', deletedata, function(data) {
            **AJAX CODE**
  
      });
      return false;
   };
  
   });
   &lt;/script&gt;
  </code></pre>
  
  <p>how do i do this?? Is this can be done directly with only Jquery?? </p>