$(function() {
$(".track").draggable({
containment:"document",
appendTo:document.body,
connectToSortable:"#playlist tbody",
revert: true,
revertDuration: 0,
cursor: "move",
helper: "clone",
cursorAt: { top: 17, left: 80 },
start: function(event, ui) {
},
drag: function(event, ui) {
}
});
$("#playlist tbody").droppable({
hoverClass: "ui-active",
accept:".track",
drop: function( event, ui ) {
if($("#playlist tbody .nothing")) $("#playlist tbody .nothing").remove();//.style.display="none";
}
}).sortable({
appendTo: document.body,
cursor: "move",
helper: "clone",
cursorAt: { top: 17, left: 80 },
});
$('.remove-td').click(function () {
$(this).parent().parent().remove();
});
});
To remove data after clicking the '✖' mark following a drag and drop action using jQuery or JavaScript, you can refer to this working example on JsFiddle: Js fiddle