3 Star 54 Fork 14

Yaohaixiao / dom.js

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
getDocument.js 458 Bytes
一键复制 编辑 原始数据 按行查看 历史
import isNode from './isNode'
/**
* 获取 Node 对象(DOM 元素)所在的文档的 documentElement 对象
* ========================================================================
* @method getDocument
* @since 1.6.0
* @param node
* @return {HTMLElement}
*/
const getDocument = (node) => {
return (
(isNode(node) ? node.ownerDocument : node.document) || window.document
).documentElement
}
export default getDocument
JavaScript
1
https://gitee.com/yaohaixiao/dom.js.git
git@gitee.com:yaohaixiao/dom.js.git
yaohaixiao
dom.js
dom.js
main

搜索帮助