/

HTML / CSS / JavaScript Tutorial

JavaScript Window method: confirm()

[this page | pdf | back links]

The confirm() method (when applied to Window objects in the JavaScript BOM) displays text in a dialog box (with an OK and Cancel button).

 

It has the following syntax with the following parameters. It returns true if the user clicks the OK button, otherwise false.

 

window.confirm(message)

 

Parameter

Required / Optional

Description

message

Optional

String specifying text to display in dialog box

 


NAVIGATION LINKS
Contents | Prev | Next | JavaScript DOM (and BOM)


Desktop view | Switch to Mobile