HTMLDocument : Document

HTML Document object.

Browser/User Agent Support

IEMozillaNetscapeOperaSafariNetscapte
3.0+1.0+2.0+7.0+1.0+no

Constructors

ConstructorIEMozillaNetscapeOperaSafariNetscapte
HTML Document object.
3.0+1.0+2.0+7.0+1.0+no
 

Properties

PropertyIEMozillaNetscapeOperaSafariNetscapte
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

MethodIEMozillaNetscapeOperaSafariNetscapte
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
  • IE: Only returns matching img and input elements.
  • Opera: Only returns matching img and input elements.
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

HTMLDocument HTMLDocument()

HTML Document object.

Visibility
internal

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:

http://www.quirksmode.org/dom/tests/document.html

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:

http://www.quirksmode.org/dom/tests/innerhtml.html

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

HTMLDocument.open | Document.close

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.

StringelementNameName of the element.

For examples, see the quirksmode test page:

http://www.quirksmode.org/dom/tests/named.html

See Also

Document.getElementById | Document.getElementsByTagName

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

HTMLDocument.close | HTMLDocument.write | Document.open

Availability

HTML DOM Level 2 | W3C

write(String text) : void

Appends a line of text to the end of the document.

StringtextText string to write.

See Also

HTMLDocument.open | Document.write

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.

StringtextText string to write.

See Also

Document.writeln

Availability

HTML DOM Level 2 | W3C