Bootstrap SweetAlert Confirm Dialog Box Model Example

By Hardik Savani June 13, 2023 Category : Bootstrap jQuery

When we deal with delete task then we always require to ask with model dialog and yes or no for conformation with message. So, if you have bootstrap then you can use simply SweetAlert plugin. Bootstrap SweetAlert plugin provide alert box, confirm dialog box and prompt box.

In this example i use bootstrap js and css and SweetAlert plugin js and css. It is very simple and it gives us better layout that way we don't need to do for design. So let's see demo and get demo code.


<html lang="en">


<title>Bootstrap SweetAlert - Confirm dialog box model with yes and no option example</title>

<link href="" rel="stylesheet">

<link href="" rel="stylesheet">

<link href="" rel="stylesheet">

<script src=""></script>

<script src="" ></script>



<div class="container">

<!-- Delete Button -->

<button class="btn btn-danger remove">Delete</button>


<script type="text/javascript">



title: "Are you sure want to remove this item?",

text: "You will not be able to recover this item",

type: "warning",

showCancelButton: true,

confirmButtonClass: "btn-danger",

confirmButtonText: "Confirm",

cancelButtonText: "Cancel",

closeOnConfirm: false,

closeOnCancel: false


function(isConfirm) {

if (isConfirm) {

swal("Deleted!", "Your item deleted.", "success");

} else {

swal("Cancelled", "You Cancelled", "error");







You can also get more information about plugin from here : bootstrap-sweetalert.