1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
|
---
title: HTMLIFrameElement
slug: Web/API/HTMLIFrameElement
tags:
- API
translation_of: Web/API/HTMLIFrameElement
---
<div>
<div>{{APIRef("HTML DOM")}}</div>
</div>
<p>The <strong><code>HTMLIFrameElement</code></strong> interface provides special properties and methods (beyond those of the {{domxref("HTMLElement")}} interface it also has available to it by inheritance) for manipulating the layout and presentation of inline frame elements.</p>
<h2 id="Properties">Properties</h2>
<p><em>Inherits properties from its parent, {{domxref("HTMLElement")}}</em>.</p>
<dl>
<dt>{{domxref("HTMLIFrameElement.align")}} {{obsolete_inline}}</dt>
<dd>Is a {{domxref("DOMString")}} that specifies the alignment of the frame with respect to the surrounding context.</dd>
<dt>{{domxref("HTMLIFrameElement.allowfullscreen")}} {{experimental_inline}}</dt>
<dd>Is a {{domxref("Boolean")}} that indicates whether or not the inline frame is willing to be placed into full screen mode. See <a href="/en-US/docs/DOM/Using_full-screen_mode" title="https://developer.mozilla.org/en/DOM/Using_full-screen_mode">Using full-screen mode</a> for details.</dd>
<dt>{{domxref("HTMLIFrameElement.contentDocument")}} {{readonlyInline}}</dt>
<dd>Returns a {{domxref("Document")}}, the active document in the inline frame's nested browsing context.</dd>
<dt>{{domxref("HTMLIFrameElement.contentWindow")}} {{readonlyInline}}</dt>
<dd>Returns a {{domxref("WindowProxy")}}, the window proxy for the nested browsing context.</dd>
<dt>{{domxref("HTMLIFrameElement.frameborder")}} {{obsolete_inline}}</dt>
<dd>Is a {{domxref("DOMString")}} that indicates whether to create borders between frames.</dd>
<dt>{{domxref("HTMLIFrameElement.height")}}</dt>
<dd>Is a {{domxref("DOMString")}} that reflects the {{htmlattrxref("height", "iframe")}} HTML attribute, indicating the height of the frame.</dd>
<dt>{{domxref("HTMLIFrameElement.longDesc")}} {{obsolete_inline}}</dt>
<dd>Is a {{domxref("DOMString")}} that contains the URI of a long description of the frame.</dd>
<dt>{{domxref("HTMLIFrameElement.marginHeight")}} {{obsolete_inline}}</dt>
<dd>Is a {{domxref("DOMString")}} being the height of the frame margin.</dd>
<dt>{{domxref("HTMLIFrameElement.marginWidth")}} {{obsolete_inline}}</dt>
<dd>Is a {{domxref("DOMString")}} being the width of the frame margin.</dd>
<dt>{{domxref("HTMLIFrameElement.name")}}</dt>
<dd>Is a {{domxref("DOMString")}} that reflects the {{htmlattrxref("name", "iframe")}} HTML attribute, containing a name by which to refer to the frame.</dd>
<dt>{{domxref("HTMLIFrameElement.sandbox")}}</dt>
<dd>Is a {{domxref("DOMSettableTokenList")}} that reflects the {{htmlattrxref("sandbox", "iframe")}} HTML attribute, indicating extra restrictions on the behavior of the nested content.</dd>
<dt>{{domxref("HTMLIFrameElement.scrolling")}} {{obsolete_inline}}</dt>
<dd>Is a {{domxref("DOMString")}} that indicates whether the browser should provide scrollbars for the frame.</dd>
<dt>{{domxref("HTMLIFrameElement.seamless")}} {{experimental_inline}}</dt>
<dd>Is a {{domxref("Boolean")}} that reflects the {{htmlattrxref("seamless", "iframe")}} HTML attribute, indicating that the inline frame should be rendered seamlessly within the parent document.</dd>
<dt>{{domxref("HTMLIFrameElement.src")}}</dt>
<dd>Is a {{domxref("DOMString")}} that reflects the {{htmlattrxref("src", "iframe")}} HTML attribute, containing the address of the content to be embedded.</dd>
<dt>{{domxref("HTMLIFrameElement.srcdoc")}}</dt>
<dd>Is a {{domxref("DOMString")}} that represents the content to display in the frame.</dd>
<dt>{{domxref("HTMLIFrameElement.width")}}</dt>
<dd>Is a {{domxref("DOMString")}} that reflects the {{htmlattrxref("width", "iframe")}} HTML attribute, indicating the width of the frame.</dd>
</dl>
<h2 id="Methods">Methods</h2>
<p><em>No specific method; inherits properties from its parent, {{domxref("HTMLElement")}}</em>.</p>
<h2 id="Specifications">Specifications</h2>
<table class="standard-table">
<tbody>
<tr>
<th scope="col">Specification</th>
<th scope="col">Status</th>
<th scope="col">Comment</th>
</tr>
<tr>
<td>{{SpecName('HTML WHATWG', "the-iframe-element.html#the-iframe-element", "HTMLIFrameElement")}}</td>
<td>{{Spec2('HTML WHATWG')}}</td>
<td>The following property has been added: <code>allowFullscreen</code>.</td>
</tr>
<tr>
<td>{{SpecName('HTML5 W3C', "embedded-content-0.html#the-iframe-element", "HTMLIFrameElement")}}</td>
<td>{{Spec2('HTML5 W3C')}}</td>
<td>The following properties are now obsolete: <code>scrolling</code>, <code>marginWidth</code>, <code>marginHeight</code>, <code>longDesc</code>, <code>frameBorder</code>, and <code>align</code>.<br>
The following properties have been added: <code>srcdoc</code>, <code>sandbox</code>, <code>seamless</code>, and <code>contentWindow</code>.</td>
</tr>
<tr>
<td>{{SpecName('DOM2 HTML', 'html.html#ID-50708718', 'HTMLIFrameElement')}}</td>
<td>{{Spec2('DOM2 HTML')}}</td>
<td>The <code>contentDocument</code> property has been added.</td>
</tr>
<tr>
<td>{{SpecName('DOM1', 'level-one-html.html#ID-50708718', 'HTMLIFrameElement')}}</td>
<td>{{Spec2('DOM1')}}</td>
<td>Initial definition.</td>
</tr>
</tbody>
</table>
<h2 id="Browser_compatibility">Browser compatibility</h2>
<p>{{Compat("api.HTMLIFrameElement")}}</p>
<h2 id="See_also">See also</h2>
<ul>
<li>The HTML element implementing this interface: {{HTMLElement("iframe")}}</li>
</ul>
|