Name

Document

Synopsis

                     window.document
document

Description

The Document object represents an HTML document and is one of the most important objects in client-side JavaScript. It was introduced in JavaScript 1.0, and a number of methods and properties were added in JavaScript 1.1. Netscape and Internet Explorer each add nonstandard methods and properties to the Document object, and the W3C DOM standardizes additional properties and methods.

Common Properties

All implementations of the Document object support the following properties. This list is followed by separate lists of properties defined by the W3C DOM Document object and by the IE 4 and Netscape 4 Document objects.

alinkColor

A string that specifies the color of activated links. Deprecated.

anchors[ ]

An array of Anchor objects, one for each anchor that appears in the document. JS 1.2.

applets[ ]

An array of Applet objects, one for each applet that appears in the document. JS 1.1.

bgColor

A string that specifies the background color of the document. Deprecated.

cookie

A string-valued property with special behavior that allows the cookies associated with this document to be queried and set.

domain

A string that specifies the Internet domain the document is from. Used for security purposes. JS 1.1.

embeds[ ]

An array of objects that represent data embedded in the document with the <embed> tag. A synonym for plugins[ ]. Some plugins and ActiveX controls can be controlled with JavaScript code. The API depends on the specific ...

Get Webmaster in a Nutshell, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.