Click to Rate and Give Feedback
MSDN
MSDN Library
HTMLDocument Prototype

Defines the properties and methods inherited by objects in the HTMLDocument prototype chain.

Syntax

HTMLN/A
ScriptingHTMLDocument.prototype

Members Table

The following table lists the members exposed by the HTMLDocument Constructor object.

Attributes/Properties

AttributePropertyDescription
activeElement Gets the object that has the focus when the parent document has focus.
alinkColor Sets or gets the color of all active links in the document.
bgColor Deprecated. Sets or retrieves a value that indicates the background color behind the object.
characterSet New for Windows Internet Explorer 9  Gets the name of the character set that is used to encode the document.
CHARSETcharset Gets or sets the character set used to encode the object.
childElementCount New for Internet Explorer 9  Retrieves the number of immediate child nodes of the current element or a zero if the element does not contain any child nodes. childElementCount does not return all child nodes, only child nodes that are nodeType =1, or element nodes.
compatible Retrieves the collection of user agents and versions declared in the X-UA-Compatible
compatMode Gets a value that indicates whether standards-compliant mode is switched on for the object.
cookie Sets or gets the string value of a cookie.
defaultCharset Gets the default character set from the current regional language settings.
defaultView New for Internet Explorer 9  Gets a reference to the window object for the document.
designMode Sets or gets a value that indicates whether the document can be edited.
dir Sets or retrieves a value that indicates the reading order of the object.
doctype Gets an object that represents the document type declaration that is associated with the current document.
documentElement Gets a reference to the root node of the document.
documentMode Retrieves the document compatibility mode of the document.
domain Sets or gets the security domain of the document.
expando Gets or sets a value indicating whether arbitrary variables can be created within the object.
fgColor Sets or gets the foreground (text) color of the document.
fileCreatedDate Retrieves the date the file was created.
fileModifiedDate Retrieves the date the file was last modified.
fileSize Retrieves the file size.
fileUpdatedDate Retrieves the date the file was last updated.
firstChild Gets a reference to the first child in the childNodes collection of the object.
firstElementChild New for Internet Explorer 9  Retrieves a reference to the first child element, or null if there are no child elements.
implementation Gets the implementation object of the current document.
inputEncoding New for Internet Explorer 9  Gets the character encoding that is used for the text that is loaded into the document object.
lastChild Gets a reference to the last child in the childNodes collection of an object.
lastElementChild New for Internet Explorer 9  Retrieves a reference to the last child element or null if there are no child elements.
lastModified Gets the date that the document was last modified, if the document supplies one.
linkColor Sets or gets the color of the document links.
MEDIAmedia Gets or sets the media type.
nameProp Retrieves the file name specified in the href or src property of the object.
nextElementSibling New for Internet Explorer 9  Retrieves a reference to the sibling element that immediately follows or null if the element does not have any sibling elements that follow it.
nextSibling Retrieves a reference to the next child of the parent for the object.
nodeName Gets the name of a particular type of node.
nodeType Retrieves the type of the requested node.
nodeValue Gets or sets the value of a node.
ownerDocument Retrieves the document object associated with the node.
parentNode Retrieves the parent object in the document hierarchy.
parentWindow Gets a reference to the container object of the window.
previousElementSibling New for Internet Explorer 9  Retrieves a reference to the immediately preceding sibling element or null if the element does not have any preceding siblings.
previousSibling Gets a reference to the previous child of the parent for the object.
protocol Sets or retrieves the protocol portion of a URL.
readyState Retrieves a value that indicates the current state of the object.
referrer Gets the URL of the location that referred the user to the current document.
SECURITY Sets the value indicating whether the source file of a frame or iframe has specific security restrictions applied.
TITLEtitle Sets or retrieves advisory information (a ToolTip) for the object.
uniqueID Retrieves an autogenerated, unique identifier for the object.
URL Sets or gets the URL for the current document.
URLUnencoded Gets the URL for the document, stripped of any character encoding.
vlinkColor Sets or gets the color of the links that the user has visited.
xmlEncoding New for Internet Explorer 9  Gets a value that represents the character encoding that is specified in the declaration of an XML document.
xmlStandalone New for Internet Explorer 9  Gets or sets the value of the standalone attribute in the declaration of an XML document.
xmlVersion New for Internet Explorer 9  Gets or sets the version attribute that is specified in the declaration of an XML document.

Collections

CollectionDescription
all Returns a reference to the collection of elements contained by the object.
anchors Retrieves a collection of all a objects that have a name and/or id property. Objects in this collection are in HTML source order.
applets Retrieves a collection of all applet objects in the document.
attributes Retrieves the collection of attributes belonging to the object.
childNodes Retrieves a collection of HTML Elements and TextNode objects that are direct descendants of the specified object.
embeds Retrieves a collection of all embed objects in the document.
forms Retrieves a collection, in source order, of all form objects in the document.
frames Retrieves a collection of all window objects defined by the given document or defined by the document associated with the given window.
images Retrieves a collection, in source order, of img objects in the document.
links Retrieves a collection of all a objects that specify the href property and all area objects in the document.
namespaces Retrieves a collection of namespace objects.
scripts Retrieves a collection of all script objects in the document.
styleSheets Retrieves a collection of styleSheet objects representing the style sheets that correspond to each instance of a link or style object in the document.

Events

EventEvent PropertyDescription
abort New for Internet Explorer 9 onabort Fires when the user aborts the download.
onactivate Fires when the object is set as the active element.
onafterupdate Fires on a databound object after successfully updating the associated data in the data source object.
onbeforeactivate Fires immediately before the object is set as the active element.
onbeforedeactivate Fires immediately before the activeElement is changed from the current object to another object in the parent document.
onbeforeeditfocus Fires before an object contained in an editable element enters a UI-activated state or when an editable container object is control selected.
onbeforeupdate Fires on a databound object before updating the associated data in the data source object.
oncellchange Fires when data changes in the data provider.
clickonclick Fires when the user clicks the left mouse button on the object.
contextmenuoncontextmenu Fires when the user clicks the right mouse button in the client area, opening the context menu.
oncontrolselect Fires when the user is about to make a control selection of the object.
ondataavailable Fires periodically as data arrives from data source objects that asynchronously transmit their data.
ondatasetchanged Fires when the data set exposed by a data source object changes.
ondatasetcomplete Fires to indicate that all data is available from the data source object.
dblclickondblclick Fires when the user double-clicks the object.
ondeactivate Fires when the activeElement is changed from the current object to another object in the parent document.
drag New for Internet Explorer 9 ondrag Fires on the source object continuously during a drag operation.
dragend New for Internet Explorer 9 ondragend Fires on the source object when the user releases the mouse at the close of a drag operation.
dragenter New for Internet Explorer 9 ondragenter Fires on the target element when the user drags the object to a valid drop target.
dragleave New for Internet Explorer 9 ondragleave Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation.
dragover New for Internet Explorer 9 ondragover Fires on the target element continuously while the user drags the object over a valid drop target.
dragstartondragstart Fires on the source object when the user starts to drag a text selection or selected object.
drop New for Internet Explorer 9 ondrop Fires on the target object when the mouse button is released during a drag-and-drop operation.
onerrorupdate Fires on a databound object when an error occurs while updating the associated data in the data source object.
focusinonfocusin Fires for an element just prior to setting focus on that element.
focusoutonfocusout Fires for the current element with focus immediately after moving focus to another element.
onhelp Fires when the user presses the F1 key while the client is the active window.
input New for Internet Explorer 9 oninput Occurs when the text content of an element is changed through the user interface.
keydownonkeydown Fires when the user presses a key.
keypressonkeypress Fires when the user presses an alphanumeric key.
keyuponkeyup Fires when the user releases a key.
load New for Internet Explorer 9 onload Fires immediately after the client loads the object.
onmessage Fires when the user sends a cross-document message with postMessage.
mousedownonmousedown Fires when the user clicks the object with either mouse button.
mousemoveonmousemove Fires when the user moves the mouse over the object.
mouseoutonmouseout Fires when the user moves the mouse pointer outside the boundaries of the object.
mouseoveronmouseover Fires when the user moves the mouse pointer into the object.
mouseuponmouseup Fires when the user releases a mouse button while the mouse is over the object.
mousewheelonmousewheel Fires when the wheel button is rotated.
mssitemodejumplistitemremoved New for Internet Explorer 9 onmssitemodejumplistitemremoved Occurs when msSiteModeShowJumpList is called, and an item has been removed from a Jump List by the user.
msthumbnailclick New for Internet Explorer 9 onmsthumbnailclick Occurs when a user clicks a button in a Thumbnail Toolbar.
onpropertychange Fires when a property changes on the object.
readystatechangeonreadystatechange Fires when the state of the object has changed.
onreset New for Internet Explorer 9  Fires when the user resets a form.
onrowenter Fires to indicate that the current row has changed in the data source and new data values are available on the object.
onrowexit Fires just before the data source control changes the current row in the object.
onrowsdelete Fires when rows are about to be deleted from the recordset.
onrowsinserted Fires just after new rows are inserted in the current recordset.
scroll New for Internet Explorer 9 onscroll Fires when the user repositions the scroll box in the scroll bar on the object.
select New for Internet Explorer 9 onselect Fires when the current selection changes.
onselectionchange Fires when the selection state of a document changes.
onselectstart Fires when the object is being selected.
onstop Fires when the user clicks the Stop button or leaves the document.
storageonstorage Fires when a Web Storage area is updated.
onstoragecommit Fires when a local Web Storage area is written to disk.

Methods

MethodDescription
addEventListener New for Internet Explorer 9  Registers an event handler for the specified event type.
adoptNode New for Internet Explorer 9  Tries to move a node from one document to the document that the document object displays.
appendChild Appends an element as a child to the object.
attachEvent Binds the specified function to an event, so that the function gets called whenever the event fires on the object.
clear Not supported.
cloneNode Copies a reference to the object from the document hierarchy.
close Closes an output stream and forces the sent data to display.
createAttribute Creates an attribute object with a specified name.
createAttributeNS New for Internet Explorer 9  Creates a reference to an attribute object that is associated with an XML namespace.
createCDATASection New for Internet Explorer 9  Creates a CDATA section that contains the specified text.
createComment Creates a comment object with the specified data.
createDocumentFragment Creates a new document.
createElement Creates an instance of the element for the specified tag.
createElementNS New for Internet Explorer 9  Creates an element from the specified namespace.
createEvent New for Internet Explorer 9  Creates a Document Object Model (DOM) event of the specified type.
createEventObject Generates an event object to pass event context information when you use the fireEvent method.
createProcessingInstruction New for Internet Explorer 9  Creates a processing instruction for an XML parser.
createStyleSheet Creates a style sheet for the document.
createTextNode Creates a text string from the specified value.
detachEvent Unbinds the specified function from the event, so that the function stops receiving notifications when the event fires.
dispatchEvent New for Internet Explorer 9  Sends an event to the current element.
elementFromPoint Returns the element for the specified x coordinate and the specified y coordinate.
execCommand Executes a command on the current document, current selection, or the given range.
fireEvent Fires a specified event on the object.
focus Causes the element to receive the focus and executes the code specified by the onfocus event.
getElementById Returns a reference to the first object with the specified value of the ID or NAME attribute.
getElementsByName Gets a collection of objects based on the value of the NAME or ID attribute.
getElementsByTagName Retrieves a collection of objects based on the specified element name.
getElementsByTagNameNS New for Internet Explorer 9  Gets a collection of nodes that match an element name from the specified namespace.
getSelection New for Internet Explorer 9  Returns an object that represents the current selection of the document.
hasChildNodes Returns a value that indicates whether the object has children.
hasFocus Gets a value indicating whether the object currently has focus.
importNode New for Internet Explorer 9  Imports a node from another document into the the document that the document object displays.
insertBefore Inserts an element into the document hierarchy as a child node of a parent object.
open Opens a new window and loads a document specified by a given URL. Also, opens a new window that uses the url parameter and the name parameter to collect the output of the write method and the writeln method.
queryCommandEnabled Returns a Boolean value that indicates whether a specified command can be successfully executed using execCommand, given the current state of the document.
queryCommandIndeterm Returns a Boolean value that indicates whether the specified command is in the indeterminate state.
queryCommandState Returns a Boolean value that indicates the current state of the command.
queryCommandSupported Returns a Boolean value that indicates whether the current command is supported on the current range.
queryCommandValue Returns the current value of the document, range, or current selection for the given command.
querySelector Retrieves the first DOM element node from descendants of the starting element node that match any selector within the supplied selector string.
querySelectorAll Retrieves all DOM element nodes from descendants of the starting element node that match any selector within the supplied selector strings.
recalc Recalculates all dynamic properties in the current document.
releaseCapture Removes mouse capture from the object in the current document.
removeChild Removes a child node from the object.
removeEventListener New for Internet Explorer 9  Removes an event handler that the addEventListener method registered.
removeNode Removes the object from the document hierarchy.
replaceChild Replaces an existing child element with a new child element.
replaceNode Replaces the object with another element.
swapNode Exchanges the location of two objects in the document hierarchy.
write Writes one or more HTML expressions to a document in the specified window.
writeln Writes one or more HTML expressions, followed by a carriage return, to a document in the specified window.

Objects

ElementObjectDescription
BODYbody Specifies the beginning and end of the document body.
HTMLSelection New for Internet Explorer 9  Represents the active selection, which is typically a highlighted block of text or other elements in the document. The active selection can be used to complete an action issued by a user or a script.
location Contains information about the current URL.
selection Represents the active selection, which is a highlighted block of text or other elements in the document that a user or a script can carry out some action on.

Remarks

For more information on this and other DOM Prototypes see Document Object Model Prototypes, Part 1: Introduction.

This prototype does not derive from any objects.

Applies To

document

See Also

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2012 Microsoft. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker