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.
The method getUserData(key) returns the object associated to a key on a this node. The object must first have been set to this node by calling setUserData with the same key.