HTML Document object.
Platform Support
| IE | Mozilla | Netscape | Opera | Safari | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
|---|
Constructors
| Constructor | Action | IE | Mozilla | Netscape | Opera | Safari | ||
|---|---|---|---|---|---|---|---|---|
|
HTMLDocument Constructor() : HTMLDocument
HTML Document object.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | ||
HTMLDocument() : HTMLDocumentHTML Document object. Returns
|
||||||||
Properties
| Property | Action | IE | Mozilla | Netscape | Opera | Safari |
|---|---|---|---|---|---|---|
|
anchors
: HTMLCollection
Array of all of the anchors in the document.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
|
||||||
|
applets
: HTMLCollection
Array of all of the applets in the document.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
|
||||||
|
body
: HTMLElement
Reference to the HTMLBodyElement for the document.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
|
||||||
|
cookie
: String
Cookies for the document.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
|
||||||
|
domain
: String
Name of the domain that the document was loaded from.
|
Show Details | 4.0+ | 1.0+ | 3.0+ | 7.0+ | 1.0+ |
|
||||||
|
forms
: HTMLCollection
Array of all of the forms (HTMLFormElement) in the document.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
|
||||||
|
images
: HTMLCollection
Array of all of the images in the document.
|
Show Details | 4.0+ | 1.0+ | 3.0+ | 7.0+ | 1.0+ |
|
||||||
|
links
: HTMLCollection
Array of all of the links in the document.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
|
||||||
|
referrer
: String
URL of the document that linked to this document.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
|
||||||
|
title
: String
Title of the document. (Contents of the title tag.)
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
|
||||||
|
URL
: String
URL of the document.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
|
||||||
Functions
| Method | Action | IE | Mozilla | Netscape | Opera | Safari | |||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
close() : void
Closes the output stream to the document.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | |||||
|
Returns
|
|||||||||||
|
static getElementsByName(String elementName) : NodeList
Returns an array of all of the elements in the document with the specified name.
|
Show Details | 5.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | |||||
Parameters
Returns
|
|||||||||||
|
open() : void
Opens an output stream for the document so that the document may be written to.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | |||||
|
Returns
|
|||||||||||
|
write(String text) : void
Appends a line of text to the end of the document.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | |||||
|
Parameters
Returns
|
|||||||||||
|
writeln(String text) : void
Appends a line of text, followed by a newline character, to the end of the document.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | |||||
|
Parameters
Returns
|
|||||||||||
References
Document.getElementById|HTMLBodyElement|Document
Availability
HTML DOM Level 2|W3C
