I want Sweet alert to work first to change the check to true, false, what to do? Please help me !
$("#our-table").on('click', '#button-delete', function () {
var check = null;
Swal.fire({
title: 'Are you sure ?',
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Comfirm'
}).then((result) => {
if (result.isConfirmed) {
check == true
}
})
if (check == true) {
return true;
}
else {
return false;
}
});