HTML
Example
one with a srcdoc attribute
<iframe srcdoc=">Hello world!
"
src
=
"
demo_iframe_srcdoc.htm
"
</
iframe
Try it »
Browser Support
The numbers in the table indicate the first browser version that supports the attribute.
| Attribute | |||||
|---|---|---|---|---|---|
| srcdoc | 20.0 | not supported | 25.0 | 6.0 | 15.0 |
Definition and Usage
The srcdoc attribute specifies the HTML content of the page to be displayed in the inline frame.
**Tip:** This attribute should be used together with the sandbox and seamless attributes.
If the browser supports the srcdoc attribute, and the srcdoc attribute is specified, it will override the content specified in the src attribute.
If the browser does not support the srcdoc attribute, and the srcdoc attribute is specified, it will display the file specified in the src attribute.
Differences Between HTML 4.01 and HTML5
The srcdoc attribute is new in HTML5.
HTML