confirm

confirm ( string _message , string _title , string[] _choices ) : int

Interrupts script execution to ask a multiple choice question.
Returns the number of the answer corresponding to _choices in the order in which the items are given (the first item by default has index 0). If the user close the box, it returns -1.

Example


if( confirm("Are you sure you want to continue?") == 1) do_something(); 


See also

prompt
alert

Parameters

_message (optional)

Question to ask

_title (optional)

Title of the dialog box

_choices (optional)

Items to show in button. It is an array of possible answers. By default it is ["No", "Yes"].
The first item will be selected by default.