How to write a confirm dialog in JavaScript with custom choices?
Instead of just "Ok" and "Cancel", I would like to have for example "This" "That" and "Other".
In short, you can't.
You might want to consider looking into using something like a jQuery UI dialog instead.
You could ask the user for an answer using:
var userChoice = prompt("Question");
You could loop that sentence until the user enters an answer within the valid ones.
You can't. Use some javascript UI (jQuery UI, YUI, Mootools) library and mimic a dialog you need.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With