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

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on by MDN contributors.