TUTORIAL前端与浏览器FETCHED

HTML DOM ownerDocument 属性

HTML DOM ownerDocument 属性 元素对象 实例 返回元素的根元素: document.getElementById('demo').ownerDocument; 尝试一下 » 定义和用法 ownerDocument 可返回某元素的根元素。 HTML中, HTML 文档本身是元素的根元素。 越多更多的文档对象请参考我们的 文档对象参考手册。 浏览器支持 所有主要浏览器都支持 ..

更新于 2026/7/16

教程详情页默认 noindex。

HTML DOM ownerDocument 属性

元素对象参考手册 元素对象

实例

返回元素的根元素:

document.getElementById("demo").ownerDocument;

尝试一下 »

定义和用法

ownerDocument 可返回某元素的根元素。

HTML中, HTML 文档本身是元素的根元素。

越多更多的文档对象请参考我们的 文档对象参考手册。


浏览器支持

Internet ExplorerFirefoxOperaGoogle ChromeSafari

所有主要浏览器都支持 ownerDocument 属性


语法

node.ownerDocument

技术细节

返回值: 节点的所有文档,如文档对象。
DOM 版本 Core Level 2 Node Object


元素对象参考手册 元素对象