November 13, 1999 - Confirm Dialog Boxes | WebReference

November 13, 1999 - Confirm Dialog Boxes

Yehuda Shiran November 13, 1999
Confirm Dialog Boxes
Tips: November 1999

Yehuda Shiran, Ph.D.
Doc JavaScript

A confirm dialog box presents a message along with OK and Cancel buttons. A confirm dialog box is created with the confirm() method of the window object. It returns a Boolean value (OK = true; Cancel = false):

if (confirm("Are you sure you want to continue?"))
  alert("Moving on...")
else
  alert("Click again to continue...");

Go ahead and give it a try: