title: Delete single item using Ajax and jQuery
body: <p>Please I need to delete item from my website using jQuery and ajax but I don't know how to get the particular id of what I want to delete or less is single see below example:</p>
  
  <p><strong>HTML CODE</strong></p>
  
  <pre><code>&lt;span id="file-1"&gt;Orange&lt;/span&gt; &lt;a id="delete-1"&gt;Delete&lt;/a&gt;
  &lt;span id="file-2"&gt;Orange&lt;/span&gt; &lt;a id="delete-2"&gt;Delete&lt;/a&gt;
  &lt;span id="file-3"&gt;Orange&lt;/span&gt; &lt;a id="delete-3"&gt;Delete&lt;/a&gt;
  &lt;span id="file-4"&gt;Orange&lt;/span&gt; &lt;a id="delete-4"&gt;Delete&lt;/a&gt;
  &lt;span id="file-5"&gt;Orange&lt;/span&gt; &lt;a id="delete-5"&gt;Delete&lt;/a&gt;
  &lt;!--Next item will have id of 6 is looping...--&gt;
  </code></pre>
  
  <p><strong>AJAX JQUERY</strong></p>
  
  <pre><code>&lt;script&gt;
      $(document).ready(function(e){
          $("#delete-").click(function(){
  //Am confused here how to know which id need to be deleted?
  var id = $('#file-').val();
          $.ajax({
          url:'/delete_reply.php',
          data:'id='+id,
          type: "POST",
          beforeSend: function(){
          $('#comment-'+id'').attr('class', 'deleting');
          },
          success: function(data){
              $('#comment-'+id'').hide();
              $(#comment-'+id'').css('display','none'); 
  
          }
            });
            });
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>Please I don't know how to pass the id of the content I want to delete to the ajax can someone help me?</p>