i m trying to remove tr from table using closest function. this function is working properly out of the $.post request but when same script is used in post request its not working. My Code is
$(".delete_cat").click(function() {
var idd = $(this).val();
$.post("<?php echo base_url() ?>category/delete",
{id:idd},
function(data) {
if (data === 1) {
var tr = $(this).closest('tr').remove();
tr.css("background-color","#FF3700");
tr.fadeOut(400, function(){
tr.remove();
});
}
}
)
})