Answers for "sweet alert message"

5

Sweetalert

<script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
<script>swal("My title", "My description", "success");</script>
Posted by: Guest on May-22-2021
0

sweetalert

swal({  title: "Good job!",  text: "You clicked the button!",  icon: "success",  button: "Aww yiss!",});
Posted by: Guest on August-12-2021
2

swal fire types

swal({
  title: "Are you sure?",
  text: "Your will not be able to recover this imaginary file!",
  type: "danger",
  showCancelButton: true,
  confirmButtonClass: "btn-danger",
  confirmButtonText: "Yes, delete it!",
  closeOnConfirm: false
},
function(){
  swal("Deleted!", "Your imaginary file has been deleted.", "success");
});
Posted by: Guest on November-10-2020
0

sweet alert add custom button

$(document).on('click', '.SwalBtn1', function() {
        //Some code 1
        console.log('Button 1');
        swal.clickConfirm();
    });
    $(document).on('click', '.SwalBtn2', function() {
        //Some code 2 
        console.log('Button 2');
        swal.clickConfirm();
    });

$('#ShowBtn').click(function(){
    swal({
        title: 'Title',
        html: "Some Text" +
            "<br>" +
            '<button type="button" role="button" tabindex="0" class="SwalBtn1 customSwalBtn">' + 'Button1' + '</button>' +
            '<button type="button" role="button" tabindex="0" class="SwalBtn2 customSwalBtn">' + 'Button2' + '</button>',
        showCancelButton: false,
        showConfirmButton: false
    });
 });
Posted by: Guest on September-24-2020
-1

sweet alert

swal("Good job!", "You clicked the button!", "success");
Posted by: Guest on November-26-2020
-1

sweet alert

swal("Hello world!");
Posted by: Guest on December-15-2020

Browse Popular Code Answers by Language