/

HTML / CSS / JavaScript Tutorial

HTML Standard attribute: srcdoc

[this page | pdf | back links]

The HTML srcdoc attribute indicates the HTML content of the page to be shown in an <iframe> element.

 

If a browser supports this attribute then it will override the content specified by the src attribute (if present). If it does not support this attribute then it will show the file specified by the src attribute (if present).

 

The srcdoc attribute is usually used in conjunction with the sandbox attribute and the seamless attribute (the seamless attribute is not currently supported by major browsers so is not covered further here).

 

Valid attribute values (when used with <iframe> elements) include:

 

Value

Description

HTML_content

HTML content of the page to show in the element

 


NAVIGATION LINKS
Contents | Prev | Next | HTML Attributes


Desktop view | Switch to Mobile