$("#deleteButton").on("click", function(evt) {
    evt.preventDefault();
    var _this = this;
    swal({
        title: "Are you sure?",
        text: "You will not be able to recover this imaginary file!",
        type: "warning",
        showCancelButton: true,
        confirmButtonColor: '#DD6B55',
        confirmButtonText: 'Yes, delete it!',
        closeOnConfirm: false
    }, function(isConfirm) {
        if (isConfirm) {
            swal("Deleted!", "Your imaginary file has been deleted.", "success");
            location.href = _this.href;
        }
    });
});
<linkhref="https://t4t5.github.io/sweetalert/dist/sweetalert.css"rel="stylesheet"/><scriptsrc="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script><scriptsrc="https://t4t5.github.io/sweetalert/dist/sweetalert-dev.js"></script><ahref='http://www.aol.com'title='Delete'id='deleteButton'class='btn btn-danger btn-sm 
deleteButton'>Delete</a>
Post a Comment for "Onclick Delete Not Stopping Before Pressing Okay"