Window ObjectLast Updated : 17 Mar 2025 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. Note: if html document contains frame or iframe, browser creates additional window objects for each frame.Methods of window objectThe important methods of window object are as follows:
Example of alert() in javascriptIt displays alert dialog box. It has message and ok button. Output of the above exampleExample of confirm() in javascriptIt displays the confirm dialog box. It has message with ok and cancel buttons. Output of the above exampleExample of prompt() in javascriptIt displays prompt dialog box for input. It has message and textfield. Output of the above exampleExample of open() in javascriptIt displays the content in a new window. Output of the above exampleExample of setTimeout() in javascriptIt performs its task after the given milliseconds. Output of the above exampleNext TopicJavaScript History Object |
We request you to subscribe our newsletter for upcoming updates.

We deliver comprehensive tutorials, interview question-answers, MCQs, study materials on leading programming languages and web technologies like Data Science, MEAN/MERN full stack development, Python, Java, C++, C, HTML, React, Angular, PHP and much more to support your learning and career growth.
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India