In the DOM, the document object provides a general way to represent HTML, XHTML1, and XML documents. In addition to the generalized document interface, the APIs listed here include HTMLDocument, which is a more specialized interface for dealing with HTML documents (e.g., cookie, alinkColor). Interfaces that are part of this more specialized HTML document have asterisks next to them in the table below2.
As you can see from the lists below, the interfaces on document deal with such things as the document type, features of the document such as its color and formatting, the plugins and applets that are exposed to the user in the document, as well as methods for creating all of the document's child nodes, or elements that typically live in the structural representation of the whole document, such as the <BODY> element, a <TABLE> and so forth.
Returns an array of attributes on the given element. Returns or sets the color of active links in the document body. anchors returns a list of all of the anchors in the document. applets returns an ordered list of the applets within a document. bgColor gets/sets the background color of the current document. body* body returns the BODY node of the current document. Returns the character set being used by the document. Returns an array of child nodes on the given element node. Indicates whether the document is rendered in Quirks or Strict mode. Returns a semicolon-separated list of the cookies for that document or sets a single cookie. Returns the window object for the containing window. Returns the Document Type Definition (DTD) of the current document. Returns the Element that is a direct child of document, which in most cases is the HTML element. domain returns the domain of the current document. embeds returns a list of the embedded OBJECTS within the current document. fgColor gets/sets the foreground color, or text color, of the current document. firstChild returns the first node in the list of direct children of the document. forms returns a list of the FORM elements within the current document. height gets/sets the height of the current document. images returns a list of the images in the current document. Returns the DOM implementation associated with the current document. Returns the date on which the document was last modified. Gets/sets the color of hyperlinks in the document. Returns an array of all the hyperlinks in the document. Returns the URI of the current document. Returns the XML namespace of the current document. Returns the node immediately following the current one in the tree. Returns the name of the current node as a string. Returns the node type of the current document. Returns the value of particular types of nodes. Returns an object reference to the document that owns the current element. Returns an object reference to the parent node. Returns an array of the available plugins. Returns the node immediately previous to the current one in the tree. Returns the URI of the page that linked to this page. The stylesheets property returns a list of the stylesheet objects on the current document. Returns the title of the current document. Returns a string containing the URL of the current document. Gets/sets the color of visited hyperlinks. Returns the width of the current document.
Clears a document. Closes a document stream for writing. Create a new attribute on the current element. Creates a new document fragment. Creates a new element. Creates a text node. Returns an object reference to the identified element. Returns a list of elements with the given name. Returns a list of elements with the given tag name. Opens a document stream for writing. Writes text to a document. Write a line of text to a document.
The Document interface that document implements is more general than HTMLDocument, which derives from it. Document is the interface that provides such basic hierarchy-manipulating methods and properties as childNodes, firstChild, nodeType, and others.