click on a button shows sweetalert code example
Example 1: sweet alert js
swal({
title: "Deleted!",
text: "Your row has been deleted.",
button: "Close", // Text on button
icon: "success", //built in icons: success, warning, error, info
timer: 3000, //timeOut for auto-close
buttons: {
confirm: {
text: "OK",
value: true,
visible: true,
className: "",
closeModal: true
},
cancel: {
text: "Cancel",
value: false,
visible: true,
className: "",
closeModal: true,
}
}
});
Example 2: jquery sweet popup
$.sweetModal.prompt('Can I haz cheezeburger?', 'Can I?', 'Nope', function(val) {
$.sweetModal('You typed: ' + val);
});