HTMLIFrameElement: src 属性
HTMLIFrameElement.src 属性是一个字符串,它反映了 src HTML 属性,其中包含要嵌入的内容的地址。
请注意,通过编程方式移除 <iframe> 的 src 属性(例如,通过 Element.removeAttribute())会导致在框架中加载 about:blank。
示例
js
const iframe = document.createElement("iframe");
iframe.src = "/";
const body = document.querySelector("body");
body.appendChild(iframe); // Fetch the image using the complete URL as the referrer
规范
| 规范 |
|---|
| HTML # dom-iframe-src |
浏览器兼容性
加载中…