ownerDocument property

Browser support:





Returns the document object that contains the current node.
Elements and attributes always have an owner document regardless of they are inserted into (appendChild, insertBefore, setAttributeNode) or removed form (removeChild, removeAttributeNode) the document tree. When a node is created (createElement, createAttribute, createComment, etc.) its ownerDocument property is set to the document object on which the create method was called. Insert and remove operations do not affect the owner document of a node. If you need to move a node to another document, use the adoptNode and importNode methods.

Syntax:

object.ownerDocument;
You can find the related objects in the Supported by objects section below.
This property is read-only.

Possible values:

Reference to the container document object.
Default: this property has no default value.
原文地址:https://www.cnblogs.com/sniper007/p/2193365.html