Skip to content
Related Articles

Related Articles

HTML | srcdoc Attribute
  • Last Updated : 30 Sep, 2019

The HTML srcdoc attribute is used to specify the HTML content of the page to show in the inline frame. This attribute is anticipated to be used beside the sandbox and seamless attributes.
If a browser supports the srcdoc attribute, it’ll override the content laid out in the src attribute (if present).
If a browser doesn’t support the srcdoc attribute, it’ll show the file laid out in the src attribute instead (if present).

Supported tag:

  • iframe


<!DOCTYPE html>
        <h1 style="color:green">GeeksforGeeks</h1>
        <iframe srcdoc="<h3>I am inside iframe.</h3>" 


Supported Browsers: The browsers supported by HTML srcdoc Attribute are listed below:

  • Google Chrome
  • Firefox
  • Apple Safari
  • Opera
My Personal Notes arrow_drop_up
Recommended Articles
Page :