The comparePoint of Range for JS returns −1 if the point is before the range, 0 if the point is in the range, and 1 if the point is after the range.
position = range.comparePoint(node, offset)
A node.
A non-negative integer.
commonAncestorContainer
createContextualFragment
intersectsNode
Range
Web Hypertext Application Technology Working Group (WHATWG)