HTMLIFrameElement.srcdoc

The srcdoc property of the HTMLIFrameElement specifies the content of the page.

Examples

var iframe = document.createElement("iframe");
iframe.srcdoc = `<!DOCTYPE html><p>Hello World!</p>`;
document.body.appendChild(iframe);

Specifications

Specification
HTML Standard
# dom-iframe-srcdoc

Browser compatibility

BCD tables only load in the browser