Get to know MDN better
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
* Some parts of this feature may have varying levels of support.
The HTMLIFrameElement interface provides special properties and methods (beyond those of the HTMLElement interface it also has available to it by inheritance) for manipulating the layout and presentation of inline frame elements.
EventTarget Node Element HTMLElement HTMLIFrameElementInherits properties from its parent, HTMLElement.
HTMLIFrameElement.alignA string that specifies the alignment of the frame with respect to the surrounding context.
HTMLIFrameElement.allowA string that indicates the Permissions Policy specified for this <iframe>.
HTMLIFrameElement.allowFullscreenA boolean value indicating whether the inline frame is willing to be placed into full screen mode. See Using fullscreen mode for details.
HTMLIFrameElement.allowPaymentRequestA boolean value indicating whether the Payment Request API may be invoked inside a cross-origin iframe.
HTMLIFrameElement.browsingTopicsA boolean property specifying that the selected topics for the current user should be sent with the request for the associated <iframe>'s source. This reflects the browsingtopics content attribute value.
HTMLIFrameElement.contentDocument Read onlyReturns a Document, the active document in the inline frame's nested browsing context.
HTMLIFrameElement.contentWindow Read onlyReturns a WindowProxy, the window proxy for the nested browsing context.
HTMLIFrameElement.credentiallessA boolean value indicating whether the <iframe> is credentialless, meaning that its content is loaded in a new, ephemeral context. This context does not have access to the parent context's shared storage and credentials. In return, the Cross-Origin-Embedder-Policy (COEP) embedding rules can be lifted, so documents with COEP set can embed third-party documents that do not. See IFrame credentialless for a deeper explanation.
HTMLIFrameElement.cspSpecifies the Content Security Policy that an embedded document must agree to enforce upon itself.
HTMLIFrameElement.featurePolicy Read onlyReturns the FeaturePolicy interface which provides a simple API for introspecting the Permissions Policies applied to a specific document.
HTMLIFrameElement.frameBorderA string that indicates whether to create borders between frames.
HTMLIFrameElement.heightA string that reflects the height HTML attribute, indicating the height of the frame.
HTMLIFrameElement.loadingA string providing a hint to the browser that the iframe should be loaded immediately (eager) or on an as-needed basis (lazy). This reflects the loading HTML attribute.
HTMLIFrameElement.longDescA string that contains the URI of a long description of the frame.
HTMLIFrameElement.marginHeightA string being the height of the frame margin.
HTMLIFrameElement.marginWidthA string being the width of the frame margin.
HTMLIFrameElement.nameA string that reflects the name HTML attribute, containing a name by which to refer to the frame.
HTMLIFrameElement.privateTokenA string representation of an options object representing a private state token operation; this object has the same structure as the RequestInit dictionary's privateToken property. Mirrors the content of the associated <iframe> element's privateToken attribute.
HTMLIFrameElement.referrerPolicyA string that reflects the referrerPolicy HTML attribute indicating which referrer to use when fetching the linked resource.
HTMLIFrameElement.sandbox Read onlyReturns a DOMTokenList that reflects the sandbox HTML attribute, indicating extra restrictions on the behavior of the nested content.
HTMLIFrameElement.scrollingA string that indicates whether the browser should provide scrollbars for the frame.
HTMLIFrameElement.srcA string that reflects the src HTML attribute, containing the address of the content to be embedded. Note that programmatically removing an <iframe>'s src attribute (e.g., via Element.removeAttribute()) causes about:blank to be loaded in the frame in Firefox (from version 65), Chromium-based browsers, and Safari/iOS.
HTMLIFrameElement.srcdocA TrustedHTML or string that represents the HTML document loaded into the frame.
HTMLIFrameElement.widthA string that reflects the width HTML attribute, indicating the width of the frame.
Also inherits methods from its parent interface, HTMLElement.
HTMLIFrameElement.getSVGDocument()Returns the embedded SVG as a Document.
| HTML # htmliframeelement |
Enable JavaScript to view this browser compatibility table.
This page was last modified on May 9, 2026 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.