sweetalert info code example

Example 1: 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" +
            "
" + '' + '', showCancelButton: false, showConfirmButton: false }); });

Example 2: change icon in sweet alert

swal({  icon: "error",});

Tags:

Misc Example