Document

The document of a window holds all the HTML elements of the web page in that window.

Properties

alinkColor

FF, IE 3

Color of a link when you click it

anchors[]

FF, IE 3

Read-only: Array of anchor objects. See "Anchor" on page 413 for more information.

applets[]

FF, IE 3

Read-only: Array storing the applets in the document. See "Applet" on page 413 for more information.

bgColor

FF, IE 3

Background color of a page. The value can be the name of a color or a hexadecimal triplet.

Example:

window.document.bgColor = "#000000";

This line makes the background of a page black.

body

FF, IE 4

Body element of a web page

cookie

FF, IE 3

HTML cookie associated with this document. See Chapter 12 for more information on cookies.

documentElement

FF, IE 5

Read-only: Root element ...

Get The Book of JavaScript, 2nd 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.