Window Object
Advertisements
Window Object
The window object represents a window in browser. An object of window is created automatically by the browser.
Window is the object of browser, it is not the object of javascript. The javascript objects are string, array, date etc. It is used to display the popup dialog box such as alert dialog box, confirm dialog box, input dialog box etc.
The window methods are mainly for opening and closing new windows. The following are the main window methods. They are:
Methods of window object
Method | Description |
---|---|
alert() | displays the alert box containing message with ok button. |
confirm() | Displays the confirm dialog box containing 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 action after specified time like calling function, evaluating expressions etc. |
Google Advertisment