title: Uncaught ReferenceError: element is not defined
body: <p>I have created a delete button that deletes a row from my database using jquery and ajax. when i click the button i get the error : <code>Uncaught ReferenceError: element is not defined.</code></p>
  
  <p>It then higlights <code>var del_id = element.attr("id");</code></p>
  
  <pre><code> &lt;a href="#" id="14" class="delbutton"&gt;&lt;i class ="fa fa-trash"&gt;&lt;/i&gt;&lt;/a&gt;
  
  
  &lt;script type="text/javascript"&gt;
      $(function() {
  
      $(".delbutton").click(function(){
      var del_id = element.attr("id");
      var info = 'id=' + del_id;
      if(confirm("Sure you want to delete this?"))
      {
      $.ajax({
      type: "POST",
      url: "feed/deletepost",
      data: info,
      success: function(){
      }
      });
      $(this).parents(".record").animate({ backgroundColor: "#fbc7c7" }, "fast")
      .animate({ opacity: "hide" }, "slow");
      }
      return false;
      });
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>Any ideas on what could be causing this?</p>