Browser/User Agent Support
| IE | Mozilla | Netscape | Opera | Safari | Netscapte | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | no |
|---|
Constructors
| Constructor | IE | Mozilla | Netscape | Opera | Safari | Netscapte |
|---|---|---|---|---|---|---|
HTML Document object. | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | no |
Properties
| Property | IE | Mozilla | Netscape | Opera | Safari | Netscapte |
|---|---|---|---|---|---|---|
Array of all of the anchors in the document. | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | no |
Array of all of the applets in the document. | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | no |
Reference to the HTMLBodyElement for the document. | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | no |
Cookies for the document. | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | no |
Name of the domain that the document was loaded from. | 4.0+ | 1.0+ | 3.0+ | 7.0+ | 1.0+ | no |
Array of all of the forms (HTMLFormElement) in the document. | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | no |
Array of all of the images in the document. | 4.0+ | 1.0+ | 3.0+ | 7.0+ | 1.0+ | no |
Array of all of the links in the document. | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | no |
URL of the document that linked to this document. | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | no |
Title of the document. (Contents of the title tag.) | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | no |
URL of the document. | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | no |
Methods
| Method | IE | Mozilla | Netscape | Opera | Safari | Netscapte |
|---|---|---|---|---|---|---|
Closes the output stream to the document. | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | no |
Returns an array of all of the elements in the document with the specified name. | 5.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | no |
| ||||||
Opens an output stream for the document so that the document may be written to. | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | no |
Appends a line of text to the end of the document. | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | no |
Appends a line of text, followed by a newline character, to the end of the document. | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | no |
References
Document.getElementById | HTMLBodyElement | Document
Availability
HTML DOM Level 2 | W3C
Constructor Detail
Property Detail
HTMLCollection anchors - read only
Array of all of the anchors in the document.
- Availability
HTML DOM Level 2 | W3C
HTMLCollection applets - read only
Array of all of the applets in the document.
- Availability
HTML DOM Level 2 | W3C
HTMLElement body
Reference to the HTMLBodyElement for the document.
-
For examples, see the quirksmode test page:
- Availability
HTML DOM Level 2 | W3C
String cookie
Cookies for the document.
- Availability
HTML DOM Level 2 | W3C
String domain - read only
Name of the domain that the document was loaded from.
- Availability
HTML DOM Level 2 | W3C
HTMLCollection forms - read only
Array of all of the forms (HTMLFormElement) in the document.
- Availability
HTML DOM Level 2 | W3C
HTMLCollection images - read only
Array of all of the images in the document.
- Availability
HTML DOM Level 2 | W3C
HTMLCollection links - read only
Array of all of the links in the document.
- Availability
HTML DOM Level 2 | W3C
String referrer - read only
URL of the document that linked to this document.
- Availability
HTML DOM Level 2 | W3C
String title
Title of the document. (Contents of the title tag.)
-
For examples, see the quirksmode test page:
- Availability
HTML DOM Level 2 | W3C
String URL - read only
URL of the document.
- Availability
HTML DOM Level 2 | W3C
Method Detail
close() : void
Closes the output stream to the document.
- See Also
- Availability
HTML DOM Level 2 | W3C
getElementsByName(String elementName) : static NodeList
Returns an array of all of the elements in the document with the specified name.
| String | elementName | Name of the element. |
-
For examples, see the quirksmode test page:
- See Also
- Availability
HTML DOM Level 2 | W3C
open() : void
Opens an output stream for the document so that the document may be written to.
- See Also
- Availability
HTML DOM Level 2 | W3C
write(String text) : void
Appends a line of text to the end of the document.
| String | text | Text string to write. |
- See Also
- Availability
HTML DOM Level 2 | W3C
writeln(String text) : void
Appends a line of text, followed by a newline character, to the end of the document.
| String | text | Text string to write. |
- See Also
- Availability
HTML DOM Level 2 | W3C
