• Post author:
  • Post category:Blog
  • Reading time:3 mins read
  • Post last modified:June 12, 2024

The methods window.altert, window.confirm, and window.prompt are methods of the window object. Which of the following is not true?

  • The alert, confrim, and prompt methods require an argument specifying the position of the dialog in which the information will be displayed.
  • The alert, confirm, and prompt methods display information in modal windows that block access to the page until they are closed.
  • You can call window methods, such as window.alert, without including the name window, so calling alert("abc") would be correct.
  • The window object represents the window in which the HTML document containing the JavaScript code currently being executed is open.
Answers Explanation & Hints:

The statement “The alert, confirm, and prompt methods require an argument specifying the position of the dialog in which the information will be displayed” is not true.

The position of the dialog in which the information will be displayed is not specified as an argument when using the alert, confirm, or prompt methods. These methods display modal dialog boxes that are centered on the user’s screen by default. The position of the dialog is handled by the browser itself, and the methods do not provide a way to control or specify the position explicitly.

The correct information regarding the given options is as follows:

  • The alert, confirm, and prompt methods display information in modal windows that block access to the page until they are closed. This means that the user needs to interact with the dialog before continuing to use the page.
  • You can call window methods, such as window.alert, without including the name window. For example, calling alert("abc") directly is correct. This is because these methods are part of the window object, and they can be accessed globally without explicitly referencing the window object.
  • The window object represents the window in which the HTML document containing the JavaScript code is open. It provides access to various properties and methods related to the window and the document within it.

So, the statement “The alert, confirm, and prompt methods require an argument specifying the position of the dialog in which the information will be displayed” is not true.

For more Questions and Answers:

JavaScipt Essentials 1 (JSE) | JSE1 – Module 3 Test Exam Answers Full 100% 

Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments