To which object does the confirm() method belongs to? (i) document (ii) window (iii) frame (iv) date
Answers
Answered by
0
The confirm() method belongs to (ii) window.
Explanation:
The confirm () method will display both an OK and a Cancel dialog box, with the message specified.
If you want a user to test or take something, a confirmation box is often used.
Note: The check box eliminates the current window from the emphasis and forces the user to read this post. Do not overuse this method, since it does not allow a user to access other parts of the page until the box is closed.
Example 1:
confirm("Press a button!");
Example 2:
var txt;
var r = confirm("Press a button!");
if (r == true) {
txt = "You pressed OK!";
} else {
txt = "You pressed Cancel!";
}
If the user pressed "Yes" (OK), the confirm () method returns correct and false.
Similar questions
Accountancy,
5 months ago
Math,
5 months ago
Hindi,
5 months ago
Computer Science,
11 months ago
Computer Science,
11 months ago
Math,
1 year ago
Math,
1 year ago