gpt4 book ai didi

javascript - 从子元素获取文档对象

转载 作者:IT王子 更新时间:2023-10-29 03:03:25 25 4
gpt4 key购买 nike

假设我在 body 中有一个 DIV 元素的 jQuery 对象。我想通过遍历获取文档对象。这可能吗?

注意:在我的情况下,window.document 不是一个选项。

谢谢。

最佳答案

element.ownerDocument将为您提供对任何 DOM 元素所属文档的引用。

关于javascript - 从子元素获取文档对象,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4158268/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com