compareDocumentPosition method

Compares the position of two nodes in a document.


USHORT retVal = object.compareDocumentPosition(otherNode);


  • otherNode [in]
    Type: [IHTMLDOMNode](aa704078(v=vs.85).md)

    The node to be compared to the reference node, which is the node executing the method.

Standards information


For information about the factors that affect the position of nodes within the DOM, see the Document Object Model (DOM) Level 3 Core Specification from the World Wide Web Consortium (W3C).

Windows Internet Explorer 9. The IHTMLDOMNode3::compareDocumentPosition method is supported only when webpages are displayed in IE9 Standards mode.