sweet alert add custom button

Solutions on MaxInterview for sweet alert add custom button by the best coders in the world

showing results for - "sweet alert add custom button"
Amanda
24 Mar 2019
1    $(document).on('click', '.SwalBtn1', function() {
2        //Some code 1
3        console.log('Button 1');
4        swal.clickConfirm();
5    });
6    $(document).on('click', '.SwalBtn2', function() {
7        //Some code 2 
8        console.log('Button 2');
9        swal.clickConfirm();
10    });
11
12$('#ShowBtn').click(function(){
13    swal({
14        title: 'Title',
15        html: "Some Text" +
16            "<br>" +
17            '<button type="button" role="button" tabindex="0" class="SwalBtn1 customSwalBtn">' + 'Button1' + '</button>' +
18            '<button type="button" role="button" tabindex="0" class="SwalBtn2 customSwalBtn">' + 'Button2' + '</button>',
19        showCancelButton: false,
20        showConfirmButton: false
21    });
22 });