HTML <iframe> srcdoc Attribute
Example
<iframe srcdoc="<h1>Hello world!</h1><p>Hello world!</p>" src="demo.html">
Your browser does not support iframe element.
</iframe>
Meaning
Inline HTML to embed, overriding the src attribute. If a browser does not support the srcdoc attribute, it will fall back to the URL in the src attribute.
Standard Syntax
<iframe srcdoc="HTMLCode">
Advertisement
Attribute Values
| Value | Description |
|---|---|
| HTML_Code | The HTML content to show in the iframe. |