Window ObjectThe 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 provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India