How to change sweetalert button text?

Dip Girase picture Dip Girase · Feb 28, 2018 · Viewed 28.5k times · Source

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?",      
});

Answer

user8718405 picture user8718405 · Feb 28, 2018

here is the answer

 swal({
            title: "Are you sure?",
            text: "you want to Cancel Operation!",
            type: "warning",
            showCancelButton: true,
            confirmButtonColor: '#DD6B55',
            confirmButtonText: 'Yes, I am sure!',
            cancelButtonText: "No, cancel it!",
            closeOnConfirm: false,
            closeOnCancel: false
        },

hope it will work for you