TOC PREV NEXT INDEX

domref



window.confirm()


Displays a dialog with a message that the user needs to respond to.

Syntax

result = window.confirm(text)
 

Parameters

text is a string.

result is a boolean value indicating whether OK or Cancel was selected.

Example

if ( window.confirm("Want to see my mood ring?")) {
 
    window.open("mood.html", "mood ring", "");
 
}
 

Notes

Unlike the alert dialog, a confirm dialog has OK and Cancel buttons, and returns true only when the user confirms the choice being presented by clicking OK. The return value of window.confirm() is often tested as part of a conditional block, as in the example above. See also window.alert(), window.prompt()

Specification

DOM Level 0. Not part of specification.
 


Netscape Communications
http://developer.netscape.com
TOC PREV NEXT INDEX