ownerDocument

Returns the node document. Returns null for documents.

MDN Reference