July 1998
Intermediate to advanced
1456 pages
65h 5m
English
confirm( ) — NN 2 IE 3 DOM n/a
confirm(message)
Displays a dialog box with a message and two clickable buttons. One
button indicates a Cancel operation;
the other button indicates the user’s approval (OK or Yes).
The text of the buttons is not scriptable. The message should ask a
question to which either button would be a logical reply. A click of
the Cancel button returns a value of
false; a click of the OK button returns a value of true.
Because this method returns a Boolean value, you can use this method inside a condition expression:
if (confirm("Reset the entire form?")) {
document.forms[0].reset( )
}Boolean value: true | false.
message
Any string, usually in the form of a question.
Read now
Unlock full access