Document Interface

The Document interface is an interface for web documents. It represents a document as a logical tree and has different properties and methods you can access as you build. 

Document

The Document interface represents any web page loaded in the browser and serves as an entry point into the web page's content, which is the DOM tree.

The DOM tree includes elements such as <body> and <table>, among many others. It provides functionality globally to the document, like how to obtain the page's URL and create new elements in the document.

The DOM (Document Object Model) Tree

The Document interface describes the common properties and methods for any kind of document. Depending on the document's type (e.g. HTML, XML, SVG, …), a larger API is available: HTML documents, served with the "text/html" content type, also implement the HTMLDocument interface, whereas XML and SVG documents implement the XMLDocument interface.


Source: Mozilla, https://developer.mozilla.org/en-US/docs/Web/API/Document
Creative Commons License This work is licensed under a Creative Commons Attribution 2.5 License.