The ownerDocument of Node for JS returns the node document. Returns null for documents.
node.ownerDocument