Each HTML document loaded into a browser window becomes a document object. It provides access to all HTML elements in a page from within the script. The document object is a part of the window object. It can be accessed through window document property.