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.
有人可以解释我如何通过 javascript 在 iframe 中更改/设置 src 属性吗?我用document.getElementById().innerHTML,但它不起作用。
document.getElementById().innerHTML
做:
document.getElementById('your_iframe_id').src = "some_location";
innerHTML 为您提供内部 html 内容,而不是 iframe 的 src 属性