JSFiddle - React, Tailwind, and code Playground
HTML
<div>Hello <a class="del" data-rel="1" href="#">удалить</a></div>
JavaScript
$(document).ready(function () {
$('.del').on('click',function(){
var delItem = $(this),
id = delItem.data('rel');
$.post('http://fiddle.jshell.net', {'id':id}, function(o) {
console.log('All good', delItem);
delItem.parent().remove();
}).fail(function () {
console.log('Ops have problem', delItem);
delItem.parent().remove();
});
return false;
});
});