O'Reilly logo

JavaScript Pocket Reference, 2nd Edition by David Flanagan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 non-standard 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 control. JS 1.2 . ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required