title: get id of div using jquery
body: <pre><code>&lt;ItemTemplate&gt;
  &lt;div class="list_row"&gt;
  &lt;div class="list_rowtext"  style="width: 16%; text-align: left; padding-left: 5px;"
  &lt;a href="#" id=&lt;%# Eval("CourseId") %&gt; class="delbutton"&gt;
  &lt;img  border="0" alt="Delete" /&gt;
  &lt;/a&gt;
  &lt;div&gt;
  &lt;ItemTemplate&gt;
  I'm using below code to delete a row from listview.although row is deleted from db but not reflected in listvoew. actually i think  this code var tr_id =   $(this).closest(".list_row"); is not getting &lt;div&gt;.
  
  $("a").click(function () {
          //Get the Id of the record to delete
          var record_id = $(this).attr("id");
          //Get the ListView Row reference
          var tr_id = $(this).closest(".list_row");
          alert(tr_id);
          // Ask user's confirmation before delete records
          if (confirm("Do you want to delete this record?")) {
  
              $.ajax({
                  type: "POST",                 
                  url: "DisplayCourses.aspx/DeleteCourses",
                  data: "{'args': '" + record_id + "'}",
                  contentType: "application/json; charset=utf-8",
                  dataType: "json",
                  success: function () {
                      tr_id.css("background-color", "lightgreen");
                      tr_id.fadeOut(500, function () {
                          tr_id.remove();
                      });
                  }
              });
          }
          return false;
      });
  </code></pre>