HTMLIFrameElement: src property

The HTMLIFrameElement.src property reflects the HTML referrerpolicy attribute of the <iframe> element defining which referrer is sent when fetching the resource.

Syntax

refStr = iframeElt.src
iframeElt.src= refStr

Example

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 Standard
# dom-iframe-src

Browser compatibility

BCD tables only load in the browser

See also