The confirm()
function shows a message box that optionally includes message text, and has OK
and Cancel
buttons.
message
message
is an optional string to display in the message box.A boolean value:
true
if the OK
button was pressedfalse
if the Cancel
button was pressed>
true
> "Can I borrow $5?"
true
confirm()
function at MDN