Which method is used to compare the placement of two nodes in the DOM hierarchy (document)?

Which method is used to compare the placement of two nodes in the DOM hierarchy (document)? Correct Answer compareDocumentPosition()

The compareDocumentPosition() method is used to compare the placement of two nodes in the DOM hierarchy (document). The return value is an integer value whose bits represent the calling Node’s relationship to otherNode within the Document.

Related Questions

What is the method used to create an element in the HTML DOM?
Which of the following frameworks focuses on DOM and Ajax utilities?
Which node type represents the root-node of the DOM tree?