srcdoc
Widely available
The srcdoc
attribute for the <iframe>
HTML element sets a string of HTML to embed in the document. The value of srcdoc
overrides loading a document from the src
attribute.
To learn more, see
HTMLIFrameElement: srcdoc property at MDN.
Compatibility (view on caniuse.com)
- Chrome 20 Released on 2012-06-26
- Chrome Android 25 Released on 2013-02-27
- Edge 79 Released on 2020-01-15
- Firefox 25 Released on 2013-10-29
- Firefox for Android 25 Released on 2013-10-29
- Safari 6 Released on 2012-07-25
- Safari on iOS 6 Released on 2012-09-10
Specifications
- HTML Standard (#attr-iframe-srcdoc), from HTML Workstream (WHATWG).