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 | Status | Comment |
---|---|---|
HTML Living Standard The definition of 'HTMLIFrameElement: srcdoc' in that specification. |
Living Standard |
Browser compatibility
BCD tables only load in the browser