1. Computing

Discuss in my forum

srcdoc - HTML Attribute for Iframes

By , About.com Guide

Srcdoc Attribute Description:

The srcdoc attribute defines the HTML source for an IFRAME element.

This attribute is valid in HTML5.

The Srcdoc Attribute is Used with These Tags:

The Srcdoc Attribute Contains:

The srcdoc attribute contains HTML to create a document that will display inside the IFRAME. In general, this means any element that can be used inside the BODY element of a document.

Here is an example of an IFRAME with a srcdoc attribute.

<iframe srcdoc="<p>This is a simple iframe with a srcdoc attribute.</p>">
Your browser does not support iframes.
</iframe>

Srcdoc Default Value:

The srcdoc attribute has no default value. If the srcdoc attribute is present, its contents should supersede any src attribute.

Srcdoc is Valid in HTML Versions:

  • HTMl5
  • XHTML5

Srcdoc Attribute DTD:

HTML5

<doctype html>

©2013 About.com. All rights reserved.