in JavaScript by
Q:
What is the use of window object?

1 Answer

0 votes
by

The window object is created automatically by the browser that represents a window of a browser. It is not an object of JavaScript. It is a browser object.

The window object is used to display the popup dialog box. Let's see with description.

Method Description
alert() displays the alert box containing the message with ok button.
confirm() displays the confirm dialog box containing the message with ok and cancel button.
prompt() displays a dialog box to get input from the user.
open() opens the new window.
close() closes the current window.
setTimeout() performs the action after specified time like calling function, evaluating expressions.

Related questions and answers

0 votes
asked Jun 28, 2020 in Python by Robindeniel
0 votes
asked Mar 20, 2021 in JavaScript by sharadyadav1986
0 votes
asked Oct 19, 2019 in JavaScript by SakshiSharma
...