JavaScript Window confirm()
JavaScript Window confirm()
The confirm() method is used to display a dialog box with a message, OK button, and Cancel button. It returns true if the user clicked on the OK button else it will return false. It is often used if we want the user to verify or accept something. It takes the focus away from the current window and forces the user to read the message.
Syntax:-
Its syntax is:- confirm(message)
Return:-
Its return is:- true if the user clicked OK else false
Further Explanation:-
Parameter | Description |
message | Optional. The text that we want to display in the confirm box. |