Represents the HTML document in a given browser window.
Remarks
You use the document object to retrieve information about the document, to examine and modify the HTML elements and text within the document, and to process events.
The document object is available at all times. You can retrieve the object by applying the document property to a window or an element object. If used by itself, document represents the document in the current window.
Examples
The following example checks for a document title and displays the title (if not null) in an alert (message) box.
if (document.title!="")
alert("The title is " + document.title)
The following example shows an event handler function that displays the current position of the mouse (relative to the upper-left corner of the document) in the browser's status window.