Q. Which method is used to compare the placement of two nodes in the DOM hierarchy (document)?
β
Correct Answer: (A)
compareDocumentPosition()
Explanation: The compareDocumentPosition() method is used to compare the placement of two nodes in the DOM hierarchy (document).