Swal custom action on confirm button code example
Example 1: swal
Swal.fire({ title: '<strong>HTML <u>example</u></strong>', icon: 'info', html: 'You can use <b>bold text</b>, ' + '<a href="//sweetalert2.github.io">links</a> ' + 'and other HTML tags', showCloseButton: true, showCancelButton: true, focusConfirm: false, confirmButtonText: '<i class="fa fa-thumbs-up"></i> Great!', confirmButtonAriaLabel: 'Thumbs up, great!', cancelButtonText: '<i class="fa fa-thumbs-down"></i>', cancelButtonAriaLabel: 'Thumbs down'})
Example 2: jquery sweet popup
$.sweetModal({
title: {
tab1: {
label: 'Tab 1'
},
tab2: {
label: 'Tab 2'
}
},
content: {
tab1: 'Tab 1',
tab2: 'Tab 2'
},
buttons: {
someOtherAction: {
label: 'Action 2',
classes: 'secondaryB bordered flat',
action: function() {
return $.sweetModal('You clicked Action 2!');
}
},
someAction: {
label: 'Action 1',
classes: '',
action: function() {
return $.sweetModal('You clicked Action 1!');
}
},
}
});