The HTML <iframe> srcdoc attribute is used to embed HTML content directly inside an iframe instead of loading it from an external URL.
- Specifies inline HTML content for the iframe.
- Can be used with sandbox for added security.
- Overrides the src attribute when both are present.
Syntax:
<iframe srcdoc="HTML_code">
Attribute Values
- HTML_code: It is used to specify the HTML content of the page which will display in an iframe element.