代码改变世界

ownerDocument property

2011-09-27 17:29  sniper007  阅读(207)  评论(0编辑  收藏  举报
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.