Consider opening any browser like Chrome, Firefox or IE. Now the browser window will be opening. This window will be opened for all the browsers, in other words we can say as The window object is supported by all browsers. This window will consist of various properties. If you want to visualize this, follow the below steps
- open any browser
- Right click anywhere on window, click inspect.
3. You will be getting a developer window like above image. Now click on the console tab and type window on it.
4. Now you can see all the properties of window in it.
So now we can move on to screen, screen is nothing but a property in window which consists of physical screen dimensions. So remember this screen is just a property of window and we can access only screen property by window.screen.
So now we comes to the heartbeat of the html document. Document is nothing but the actual content of the page.
Document is also a property of window which contains the content of the page.
When an HTML document is loaded into a web browser , it becomes a document object. How to check this? So when you type window.document, it will return nothing but the html code.
Important points to remember:
- Document and size are properties of window.
Document- Content of the window aka html document.
Screen- Physical screen dimensions