HTML DOM ownerDocumentProperty

元素对象参考手册Element Object

Examples

Return the root element of an element:

document.getElementById("demo").ownerDocument;

Try it Yourself »

Definition and Usage

ownerDocument returns the root element of an element.

In HTML, the HTML document itself is the root element of an element.

For more document objects, please refer to ourDocument Object Reference Manual。


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the ownerDocument property.


Syntax

node.ownerDocument

Technical Details

Return Value: The document of the node, such as a document object.
DOM Version Core Level 2 Node Object


元素对象参考手册Element Object

Other Extensions