gpt4 book ai didi

javascript - 如何使用jquery在没有iframe的情况下获取body的innerHtml

转载 作者:搜寻专家 更新时间:2023-10-31 08:21:57 25 4
gpt4 key购买 nike

我有这样的 html 页面

<body><iframe ></iframe><div id="menu">......</div>.....</body>

我想获取正文的 innerHTML 但没有 iframe?我如何在 jquery 中做到这一点?

最佳答案

试试.clone :

$(document.body)
.clone()
.find('iframe')
.remove()
.end()
.html();

关于javascript - 如何使用jquery在没有iframe的情况下获取body的innerHtml,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4727697/

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