What is the use of window object?

What is the use of window object?

Window is not the object of Javascript, but rather an object of the browser. The window object represents an open window in a browser.

If a document contains frames, i.e. the <iframe> tags, then the window object can be used to make the browser create one window object for the HTML document, and one additional window object for each frame.

It should be noted that there are no official standards for the Browser Object Model (BOM). However, most browsers do support it as most modern browsers have implemented the same methods and properties for JavaScript interactivity. Hence, they all support the methods and properties of BOM.

When the window object is used, all global JavaScript objects, functions, and variables automatically become members of the window object.

Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.