I want to implement javascript function to delete confirmation. After clicking ok button of confirmation alert table tr should be removed from front end. I have used $("#confirm-btn-alert").click(function() for confirmation alert which is in sweet-alert-script.js and function SomeDeleteRowFunction(o) which is in newfile.html for remove tr
sweet-alert-script.js
$(document).ready(function(){
$("#confirm-btn-alert").click(function(){
swal({
title: "Are you sure?",
text: "Once deleted, you will not be able to recover this imaginary file!",
icon: "warning",
buttons: true,
dangerMode: true,
})
.then((willDelete) => {
if (willDelete) {
swal("Poof! Your imaginary file has been deleted!", {
icon: "success",
});
} else {
swal("Your imaginary file is safe!");
}
});
});
});
newfile.html
<script>
function SomeDeleteRowFunction(o) {
var p=o.parentNode.parentNode;
p.parentNode.removeChild(p);
}
</script>
okbutton of confirmation message.scripttag is missing a>sign