Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change sweetalert button text?

Tags:

People also ask

How do you customize SweetAlert?

Add buttons As you can see, the plugin adds an OK button to the alert. The button is fully customizable. You can even add new buttons to the alert message. Sometimes, you may need to handle button click events.

How do you call a sweet alert on button click?

All you have to do is call the swal() function. swal("Here's a message!", " Have a nice day!")


I want to change the 'Ok' button with 'Select patient' and the 'Cancel' to 'Speed case'. How can I do that?

swal({
  text: "Start new case by",
  buttons: true,
  confirmButtonText: "Select Patient?",
  cancelButtonText: "Speed Case?",      
});