HTMLIFrameElement: src property - Web APIs | MDN
Example
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
Specifications
| Specification |
|---|
| HTML # dom-iframe-src |