--- title: HTMLIFrameElement slug: Web/API/HTMLIFrameElement tags: - API translation_of: Web/API/HTMLIFrameElement ---
{{APIRef("HTML DOM")}}

The HTMLIFrameElement 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.

Properties

Inherits properties from its parent, {{domxref("HTMLElement")}}.

{{domxref("HTMLIFrameElement.align")}} {{obsolete_inline}}
Is a {{domxref("DOMString")}} that specifies the alignment of the frame with respect to the surrounding context.
{{domxref("HTMLIFrameElement.allowfullscreen")}} {{experimental_inline}}
Is a {{domxref("Boolean")}} that indicates whether or not the inline frame is willing to be placed into full screen mode. See Using full-screen mode for details.
{{domxref("HTMLIFrameElement.contentDocument")}} {{readonlyInline}}
Returns a {{domxref("Document")}}, the active document in the inline frame's nested browsing context.
{{domxref("HTMLIFrameElement.contentWindow")}} {{readonlyInline}}
Returns a {{domxref("WindowProxy")}}, the window proxy for the nested browsing context.
{{domxref("HTMLIFrameElement.frameborder")}} {{obsolete_inline}}
Is a {{domxref("DOMString")}} that indicates whether to create borders between frames.
{{domxref("HTMLIFrameElement.height")}}
Is a {{domxref("DOMString")}} that reflects the {{htmlattrxref("height", "iframe")}} HTML attribute, indicating the height of the frame.
{{domxref("HTMLIFrameElement.longDesc")}} {{obsolete_inline}}
Is a {{domxref("DOMString")}} that contains the URI of a long description of the frame.
{{domxref("HTMLIFrameElement.marginHeight")}} {{obsolete_inline}}
Is a {{domxref("DOMString")}} being the height of the frame margin.
{{domxref("HTMLIFrameElement.marginWidth")}} {{obsolete_inline}}
Is a {{domxref("DOMString")}} being the width of the frame margin.
{{domxref("HTMLIFrameElement.name")}}
Is a {{domxref("DOMString")}} that reflects the {{htmlattrxref("name", "iframe")}} HTML attribute, containing a name by which to refer to the frame.
{{domxref("HTMLIFrameElement.sandbox")}}
Is a {{domxref("DOMSettableTokenList")}} that reflects the {{htmlattrxref("sandbox", "iframe")}} HTML attribute, indicating extra restrictions on the behavior of the nested content.
{{domxref("HTMLIFrameElement.scrolling")}} {{obsolete_inline}}
Is a {{domxref("DOMString")}} that indicates whether the browser should provide scrollbars for the frame.
{{domxref("HTMLIFrameElement.seamless")}} {{experimental_inline}}
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.
{{domxref("HTMLIFrameElement.src")}}
Is a {{domxref("DOMString")}} that reflects the {{htmlattrxref("src", "iframe")}} HTML attribute, containing the address of the content to be embedded.
{{domxref("HTMLIFrameElement.srcdoc")}}
Is a {{domxref("DOMString")}} that represents the content to display in the frame.
{{domxref("HTMLIFrameElement.width")}}
Is a {{domxref("DOMString")}} that reflects the {{htmlattrxref("width", "iframe")}} HTML attribute, indicating the width of the frame.

Methods

No specific method; inherits properties from its parent, {{domxref("HTMLElement")}}.

Specifications

Specification Status Comment
{{SpecName('HTML WHATWG', "the-iframe-element.html#the-iframe-element", "HTMLIFrameElement")}} {{Spec2('HTML WHATWG')}} The following property has been added: allowFullscreen.
{{SpecName('HTML5 W3C', "embedded-content-0.html#the-iframe-element", "HTMLIFrameElement")}} {{Spec2('HTML5 W3C')}} The following properties are now obsolete: scrolling, marginWidth, marginHeight, longDesc, frameBorder, and align.
The following properties have been added: srcdoc, sandbox, seamless, and contentWindow.
{{SpecName('DOM2 HTML', 'html.html#ID-50708718', 'HTMLIFrameElement')}} {{Spec2('DOM2 HTML')}} The contentDocument property has been added.
{{SpecName('DOM1', 'level-one-html.html#ID-50708718', 'HTMLIFrameElement')}} {{Spec2('DOM1')}} Initial definition.

Browser compatibility

{{Compat("api.HTMLIFrameElement")}}

See also