Question 70

Which of the following methods in Java Script will display a window having a dialog box with a specified message, along with an OK and CANCEL button as options?

  1. Aprompt ()
  2. Balert ()
  3. Cconfirm ()
  4. Drequest ()
Show answerHide answer

Correct answer: (C) confirm ()

Explanation

confirm() shows a dialog with a message and OK and Cancel buttons and returns true or false. alert() has only OK, and prompt() also asks for text input.

From DSSSB TGT Computer Science Practice Set 2

This is question 70 of DSSSB TGT Computer Science Practice Set 2. See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.