compareDocumentPosition

open external fun compareDocumentPosition(other: Node): NodePosition(source)

The compareDocumentPosition() method of the Node interface reports the position of its argument node relative to the node on which it is called.

MDN Reference