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
|
Inherited Properties
Property | Action | IE | Mozilla | Netscape | Opera | Safari |
---|---|---|---|---|---|---|
Reference to the Element that currently has focus.
|
No Details | 4.0+ | no | no | no | no |
|
||||||
alinkColor
: String
Specifies the color of active links.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
|
||||||
anchors
: Array
Array of all of the Anchor objects in a document.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
|
||||||
applets
: Array
Array of all of the Applet objects in a document.
|
Show Details | 4.0+ | 1.0+ | 3.0+ | 7.0+ | 1.0+ |
|
||||||
bgColor
: String
Background color of a document.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
|
||||||
body
: Element
Reference to the body or frameset element.
|
Show Details | 4.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+ |
|
||||||
Character set of the document.
|
No Details | 4.0+ | no | no | no | no |
|
||||||
Character set of the document.
|
No Details | no | 1.0+ | 6.0+ | no | 1.0+ |
|
||||||
Array of style properties for CSS classes.
|
No Details | no | no | 4.0+ | no | no |
|
||||||
compatMode
: Boolean
Indicates whether the document has standards-compliant mode turned on.
|
Show Details | 6.0+ | 1.75+ | 7.0+ | no | no |
|
||||||
cookie
: String
Value of the cookie that the browser has set for the document.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
|
||||||
Default character set for the document.
|
No Details | 4.0+ | no | no | no | no |
|
||||||
designMode
: String
Specifies that design mode for an HTML document is "on" or "off."
|
Show Details | 5.0+ | 1.4+ | 7.0+ | no | no |
|
||||||
dir
: String
Text direction of the content in the document.
|
Show Details | 5.0+ | 1.0+ | 6.0+ | no | no |
|
||||||
doctype
: DocumentType
Document Data Type (DTD) associated with this document.
|
Show Details | 6.0+ | 1.0+ | 6.0+ | 7.0+ | no |
|
||||||
documentElement
: Element
Root element in a document.
|
Show Details | 5.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+ |
|
||||||
domain
: String
Internet domain of the document.
|
Show Details | 4.0+ | 1.0+ | 3.0+ | 7.0+ | 1.0+ |
|
||||||
embeds
: Array
Array of all embedded objects in the document.
|
Show Details | 4.0+ | 1.0+ | 3.0+ | 7.0+ | 1.0+ |
|
||||||
expando
: Boolean
Indicates whether a client-side object may have instance properties added to it.
|
Show Details | 4.0+ | no | no | no | no |
|
||||||
fgColor
: String
Font color of the document text.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
|
||||||
Date that the document was created.
|
No Details | 4.0+ | no | no | no | no |
|
||||||
Date that the document was last modified.
|
No Details | 4.0+ | no | no | no | no |
|
||||||
File size (in bytes) of the document.
|
No Details | 4.0+ | no | no | no | no |
|
||||||
forms
: Array
Array of all of the Forms in the document.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
|
||||||
frames
: Array
Array of all of the Frames in the document.
|
Show Details | 4.0+ | no | no | no | no |
|
||||||
Height of the entire HTML document (in pixels).
|
No Details | no | 1.0+ | 4.0+ | 7.0+ | 1.0+ |
|
||||||
ids
: Array
Array of style properties in the document set by the Id attribute.
|
Show Details | no | no | 4.0+ | no | no |
|
||||||
images
: Array
Array of Image objects in the document.
|
Show Details | 4.0+ | 1.0+ | 3.0+ | 7.0+ | 1.0+ |
|
||||||
implementation
: Object
Object that specifies whether or not and at what level the browser supports the specified feature.
|
Show Details | 6.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+ |
|
||||||
lastModified
: String
Date that the document was last modified.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
|
||||||
layers
: Array
Array of all of the Layer elements in the document.
|
Show Details | no | no | 4.0+ | no | no |
|
||||||
linkColor
: String
Color of the unvisited links in the document.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
|
||||||
links
: Array
Array of all of the links in the document.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
|
||||||
location
: Object
Complete URL of the document.
|
Show Details | 3.0+ | no | 3-4 | no | no |
|
||||||
The media that the document is intended for.
|
No Details | 5.5+ | no | no | no | no |
|
||||||
Information about the document MIME type.
|
No Details | 5.0+ | no | no | no | no |
|
||||||
Array of the XML Namespaces for a document.
|
No Details | 5.5+ | no | no | no | no |
|
||||||
Fires when the element becomes active.
|
No Details | 4.0+ | no | no | no | no |
|
||||||
Fires immediately before the selection is cut to the clipboard.
|
No Details | 4.0+ | no | no | no | 1.0+ |
|
||||||
Fires immediately before the element stops being the active element.
|
No Details | 4.0+ | no | no | no | no |
|
||||||
Fires immediately before the element receives focus prior to being edited.
|
No Details | 4.0+ | no | no | no | no |
|
||||||
Fires immediately before the selection is pasted from the clipboard to the element.
|
No Details | 4.0+ | no | no | no | 1.0+ |
|
||||||
Fires when the element is clicked.
|
No Details | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+ |
|
||||||
Fires when the element is right-clicked and the context menu opens.
|
No Details | 4.0+ | no | no | no | 1.0+ |
|
||||||
Fires immediately before the element is selected.
|
No Details | 4.0+ | no | no | no | no |
|
||||||
Fires when the element is cut to the clipboard.
|
No Details | 4.0+ | no | no | no | 1.0+ |
|
||||||
Fires when the element is double-clicked.
|
No Details | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+ |
|
||||||
Fires when the element is dragged.
|
No Details | 4.0+ | no | no | no | 1.0+ |
|
||||||
Fires when the element is released from being dragged.
|
No Details | 4.0+ | no | no | no | 1.0+ |
|
||||||
Fires when the element has another object dragged onto it that can be dropped on the element.
|
No Details | 4.0+ | no | no | no | 1.0+ |
|
||||||
Fires when an element has an object dragged out of it that could be dropped onto the element.
|
No Details | 4.0+ | no | no | no | 1.0+ |
|
||||||
Fires when an element has an object dragged over it that could be dropped onto the element.
|
No Details | 4.0+ | no | no | no | 1.0+ |
|
||||||
Fires immediately before an element is dragged.
|
No Details | 4.0+ | no | no | no | 1.0+ |
|
||||||
Fires when an object is dropped onto the element.
|
No Details | 4.0+ | no | no | no | 1.0+ |
|
||||||
Fires when a user presses the F1 key to activate help.
|
No Details | 4.0+ | no | no | no | no |
|
||||||
Fires when a user presses down on a key while the element has focus.
|
No Details | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+ |
|
||||||
Fires when a user presses a key or holds down the key while the element has focus.
|
No Details | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+ |
|
||||||
Fires when a user releases a key while the element has focus.
|
No Details | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+ |
|
||||||
Fires when a user clicks down on the mouse button while the element has focus.
|
No Details | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+ |
|
||||||
Fires when the mouse moves while the pointer over the element.
|
No Details | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+ |
|
||||||
Fires when the mouse pointer moves off of the element.
|
No Details | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+ |
|
||||||
Fires when the mouse pointer moves over the element.
|
No Details | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+ |
|
||||||
Fires when the user releases the mouse button while the element has focus.
|
No Details | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+ |
|
||||||
Fires when the clipboard contents are pasted onto the element.
|
No Details | 4.0+ | no | no | no | 1.0+ |
|
||||||
Fires when one of the properties of the element changes.
|
No Details | 4.0+ | no | no | no | no |
|
||||||
Fires when the ready state of the element changes.
|
No Details | 4.0+ | no | no | no | no |
|
||||||
Fires immediately before an element is about to be resized.
|
No Details | 4.0+ | no | no | no | 1.0+ |
|
||||||
Fires when the element is finished being resized.
|
No Details | 4.0+ | no | no | no | no |
|
||||||
Fires immediately before a user resizes the element.
|
No Details | 4.0+ | no | no | no | no |
|
||||||
Fires when the selected state of the document changes.
|
No Details | 5.5+ | no | no | no | no |
|
||||||
Fires when a user clicks the Stop button on the browser.
|
No Details | 5.5+ | no | no | no | no |
|
||||||
parentWindow
: Object
Reference to the parent Window of the document.
|
Show Details | 4.0+ | no | no | 8.0+ | no |
|
||||||
plugins
: Array
Array of plugins installed in the browser.
|
Show Details | 2.0+ | 1.0+ | 1.0+ | 7.0+ | 1.0+ |
|
||||||
protocol
: String
Full name of the protocol (not "http") used to retrieve the document.
|
Show Details | 4.0+ | no | no | no | no |
|
||||||
referrer
: String
URL of the referring document.
|
Show Details | 2.0+ | 1.0+ | 1.0+ | 7.0+ | 1.0+ |
|
||||||
Array of all of the Scripts in the document.
|
No Details | 4.0+ | no | no | no | no |
|
||||||
Information about the security certificate for the document.
|
No Details | 5.5+ | no | no | no | no |
|
||||||
Object representing any currently selected text.
|
No Details | 4.0+ | no | no | no | no |
|
||||||
styleSheets
: Array
Array of all of the styleSheets in the document.
|
Show Details | 4.0+ | 1.0+ | 6.0+ | 7.0+ | 1.2+ |
|
||||||
Array of style properties for certain HTML tags.
|
No Details | no | no | 4.0+ | no | no |
|
||||||
title
: String
Title of the document.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
|
||||||
URL
: String
URL of the document.
|
Show Details | 4.0+ | 1.0+ | 2.0+ | no | no |
|
||||||
URLUnencoded
: String
URL-unencoded version of the URL.
|
Show Details | 5.5+ | no | no | no | no |
|
||||||
vlinkColor
: String
Color of visited links.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
|
||||||
Width of the HTML document (in pixels).
|
No Details | no | 1.0+ | 4.0+ | 7.0+ | 1.0+ |
|
||||||
Reference to the top-level node of the XML DOM used by the document.
|
No Details | 5.0+ | no | no | no | no |
|
||||||
Reference to the XSL document for the document.
|
No Details | 5.0+ | no | no | no | no |
|
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+ |
|
Inherited Functions
Method | Action | IE | Mozilla | Netscape | Opera | Safari | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
captureEvents(Number eventMask) : void
Sets an document to capture the events specified by eventMask.
|
Show Details | no | no | 4.0+ | no | no | ||||||||||||||
Parameters
Returns
|
||||||||||||||||||||
clear() : void
Clears the content from the document.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | no | 1.0+ | ||||||||||||||
Returns
|
||||||||||||||||||||
close() : Object
Stops the output stream to the document.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | ||||||||||||||
Returns
|
||||||||||||||||||||
contextual(String context) : void
Sets a concept to select tags to style.
|
Show Details | no | no | 4.0 | no | no | ||||||||||||||
Parameters
Returns
|
||||||||||||||||||||
createCDATASection(Object data) : CDATASection
Creates a new CDATASection node
|
Show Details | no | 1.0+ | no | no | no | ||||||||||||||
Parameters
Returns
|
||||||||||||||||||||
createComment(String data) : Comment
Creates a new Comment node
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | ||||||||||||||
Parameters
Returns
|
||||||||||||||||||||
createDocumentFragment() : DocumentFragment
Creates an empty
DocumentFragment object |
Show Details | 6.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | ||||||||||||||
Returns
|
||||||||||||||||||||
createProcessingInstruction(String target, String data) : ProcessingInstruction
Creates a new
ProcessingInstruction node with the specified target and data strings. |
Show Details | no | 1.0+ | no | no | no | ||||||||||||||
Parameters
Returns
|
||||||||||||||||||||
elementFromPoint(Number x, Number y) : HTMLElement
Returns the element found at the specified x, y location in the document.
|
Show Details | 4.0+ | no | no | no | no | ||||||||||||||
Parameters
Returns
|
||||||||||||||||||||
getSelection() : String
Returns the text currently selected by the user.
|
Show Details | no | no | 4.0+ | no | no | ||||||||||||||
Returns
|
||||||||||||||||||||
isSupported(String feature, [String version]) : Boolean
Returns true if the specified feature and version are supported.
|
Show Details | no | 1.0+ | 6.0+ | no | no | ||||||||||||||
Parameters
Returns
|
||||||||||||||||||||
open([String mimeType,] [String name,] [String features,] [Boolean replace]) : void
Opens the document for writing.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | ||||||||||||||
Parameters
Returns
|
||||||||||||||||||||
queryCommandEnabled(String command) : Boolean
Returns true if the specified command is enabled.
|
Show Details | 4.0+ | 1.4+ | 7.1+ | no | no | ||||||||||||||
Parameters
Returns
|
||||||||||||||||||||
quertyCommandIndeterm(String command) : Boolean
Returns true if the specified command is in an indeterminate state.
|
Show Details | 4.0+ | 1.4+ | 7.1+ | no | no | ||||||||||||||
Parameters
Returns
|
||||||||||||||||||||
queryCommandState(String command) : Boolean
Returns true if the specified command has been executed on the object.
|
Show Details | 4.0+ | 1.4+ | 7.1+ | no | no | ||||||||||||||
Parameters
Returns
|
||||||||||||||||||||
queryCommandSupported(String command) : Boolean
Returns true if the specified command is supported.
|
Show Details | 4.0+ | 1.4+ | 7.1+ | no | no | ||||||||||||||
Parameters
Returns
|
||||||||||||||||||||
queryCommandValue(String command) : Object
Returns the value of the specified command for the document. Returns false if the command is not supported.
|
Show Details | 4.0+ | 1.4+ | 7.1+ | no | no | ||||||||||||||
Parameters
Returns
|
||||||||||||||||||||
recalc([Boolean forceAll]) : void
Reevaluates all dynamic properties in the document.
|
Show Details | 5.0+ | no | no | no | no | ||||||||||||||
Parameters
Returns
|
||||||||||||||||||||
releaseEvents(Number eventMask) : Object
Sets the document to stop capturing the specified type of events.
|
Show Details | no | no | 4.0+ | no | no | ||||||||||||||
Parameters
Returns
|
||||||||||||||||||||
routeEvent(Object event) : Object
Routes the specified event to the next event handler.
|
Show Details | no | no | 4.0+ | no | no | ||||||||||||||
Parameters
Returns
|
||||||||||||||||||||
selection() : Object
Gives information about the currently selected objects in the document.
|
Show Details | 4.0+ | no | no | no | no | ||||||||||||||
Returns
|
||||||||||||||||||||
write(String string) : Object
Writes the specified string of text to the end of the document.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | ||||||||||||||
Parameters
Returns
|
||||||||||||||||||||
writeln(String string) : Object
Writes the specified string of text to the end of the document and adds a newline character at the end of the text.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | ||||||||||||||
Parameters
Returns
|
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