Partilhar via


IHTMLDOMNode interface

Provides methods to access all of the nodes in the document object model (DOM), to iterate the nodes, to insert nodes, to remove nodes, and to get the attributes of a node.

Members

The IHTMLDOMNode interface inherits from the IDispatch interface. IHTMLDOMNode also has these types of members:

  • Methods
  • Properties

Methods

The IHTMLDOMNode interface has these methods.

Method Description
appendChild

Appends an element as a child to the object.

cloneNode

Copies a reference to the object from the document hierarchy.

hasChildNodes

Returns a value that indicates whether the object has children.

insertBefore

Inserts an element into the document hierarchy as a child node of a parent object.

removeChild

Removes a child node from the object.

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.

 

Properties

The IHTMLDOMNode interface has these properties.

Property Description

childnodes

Gets the child nodes of the document object.

firstChild

Gets a reference to the first child in the childNodes collection of the object.

lastChild

Gets a reference to the last child in the childNodes collection of an object.

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.

parentNode

Retrieves the parent object in the document hierarchy.

previousSibling

Gets a reference to the previous child of the parent for the object.

 

Remarks

To get an IHTMLDOMNode interface pointer for an element, call QueryInterface on an IHTMLElement interface pointer, an IHTMLElement2 interface pointer, an IHTMLElement3 interface pointer, or anIHTMLElement4 interface pointer. The IHTMLDOMNode interface is used in a variety of other contexts; see the See Also section.

Requirements

Minimum supported client

Windows XP

Minimum supported server

Windows 2000 Server

Header

Mshtml.h

IDL

Mshtml.idl

DLL

Mshtml.dll

See also

IDispatch

Reference

IHTMLDOMNode2

IHTMLDocument3::createTextNode

IHTMLDocument5::createComment

IHTMLDocument5::doctype

IHTMLDOMNode::appendChild

IHTMLDOMTextNode::splitText