Identify the JavaScript method used for the following purposes. a. It return true if ok is pressed and false if cancel is pressed. b. It is used for getting input from the user. c. It is used for displaying short messages
Answers
Answer:
Summary. The confirm() is a method of the window object. The confirm() shows a system dialog that consists of a question and two buttons: OK and Cancel . The confirm() returns true if the OK button was clicked or false if the Cancel button was selected.
Hope this will help you.
Answer:
The confirm() method is used to display a modal dialog with an optional message and two buttons, OK and Cancel. It returns true if the user clicks “OK”, and false otherwise. It prevents the user from accessing other parts of the page until the box is closed. message is the optional string to be displayed in the dialog.
The confirm() is a method of the window object. The confirm() shows a system dialog that consists of a question and two buttons: OK and Cancel . The confirm() returns true if the OK button was clicked or false if the Cancel button was selected.