Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个带有标签的 HTML 文件。在 DIV 页面的某个地方,我有一个 iframe,它称为 HTML 文件。此 HTML 文件调用 Javascript。我希望能够在我的 JS 文件中更改标签的 innerHTML。有什么办法吗?
如果我理解你,你可以使用这个 js 从 iframe 更改父页面中的 html:
window.parent.document.getElementById('label')