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.