HTML:标记语言
CSS:样式语言
JavaScript:脚本语言
Web API:编程接口
所有 Web 技术
学习 Web 开发
发现我们的工具
更好地了解 MDN
此特性已相当成熟,可在许多设备和浏览器版本上使用。自 2015 年 7 月以来,各浏览器均已提供此特性。
Node 接口的只读 ownerDocument 属性返回节点的顶级文档对象。
Node
ownerDocument
一个 Document,它是创建所有子节点的顶级对象。
Document
如果此属性用于节点本身是文档的情况,则值为 null。
null
// Given a node "p", get the top-level HTML // child of the document object const d = p.ownerDocument; const html = d.documentElement;
加载中…