jQuery ajax使用$,this.parent

div=$(this).parent(); //先获取父级元素

div.remove(); //再删除

$(".delStu").click(function () {

td = $(this).parent().parent();

if (confirm("您确认删除么")) {

$.ajax({

url: "/Demo/Student/DelStudent",

type: "POST",

data: { ID: $(this).attr('data-id') },

success: function (data) {

if(data.msg=="删除成功");

{

console.log(data);

td.remove();

}

},

error: function () {

console.log("error");

}

})

} else {

}

});