Get the node type of the owner document of a <p> element:
var x = document.getElementById("myP").ownerDocument.nodeType;
Try it Yourself »
The ownerDocument property returns the owner document of a node, as a Document object.
In HTML, the HTML document itself is always the ownerDocument of an element.
Read more about the Document object in our Document object reference.
Property | |||||
---|---|---|---|---|---|
ownerDocument | Yes | Yes | Yes | Yes | Yes |
node.ownerDocument
Return Value: | The owner document of the node, as a Document object |
---|---|
DOM Version | Core Level 2 Node Object |
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!