MCQ Single Best Answer Easy

QWhich technique is used to compare the positions of two nodes within a DOM document?

ID: #5191 Javascript DOM & Event Handling MCQ 117 views
Question Info
#5191Q ID
EasyDifficulty
Javascript DOM & Event Handling MCQTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A compareDocumentPosition()
  • B cloneNode()
  • C getUserData()
  • D getFeature()
Correct Answer: Option A

Explanation

To compare the positions of two nodes in the DOM hierarchy, use the compareDocumentPosition() function (document).
The returned response is an integer whose bits denote the relationship between the caller node and other nodes in the document.

Share This Question

Challenge a friend or share with your study group.