<script src="~/Dist/sweetalert.min.js"></script> <link href="~/Dist/sweetalert.css" rel="stylesheet" />
<a class="btn btn-success block" id="BlockUnblockBtn" onclick="BlockUnblock(this,event);">Block</a>
function BlockUnblock(ctl, event) { 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!", cancelButtonText: "No, cancel plx!", closeOnConfirm: false, closeOnCancel: false }, function (isConfirm) { if (isConfirm) { swal("Deleted!", "Your imaginary file has been deleted.", "success"); } else { swal("Cancelled", "Your imaginary file is safe :)", "error"); } }); }
<!DOCTYPE html> <html lang="en"> <head> <script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script> <style> .myClass{ width:400px; height:200px; } </style> </head> <body> <script> swal({ title: "Are you sure?", text: "You will not be able to recover this imaginary file!", className: "myClass", }); </script> </body> </html>
customClass: swal-size-sm
.swal-size-sm { width: 200px !important; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)