web api interface
HTMLIFrameElement
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.
Instance properties
Inherits properties from its parent, HTMLElement.
alignDeprecated- : A string that specifies the alignment of the frame with respect to the surrounding context.
allow- : A string that indicates the Permissions Policy specified for this
<iframe>.
- : A string that indicates the Permissions Policy specified for this
allowFullscreen- : A boolean value indicating whether the inline frame is willing to be placed into full screen mode. See Using fullscreen mode for details.
allowPaymentRequestDeprecated- : A boolean value indicating whether the Payment Request API may be invoked inside a cross-origin iframe.
browsingTopicsDeprecated- : A 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 thebrowsingtopicscontent attribute value.
- : A boolean property specifying that the selected topics for the current user should be sent with the request for the associated
contentDocumentRead only- : Returns a
Document, the active document in the inline frame’s nested browsing context.
- : Returns a
contentWindowRead only- : Returns a WindowProxy, the window proxy for the nested browsing context.
credentiallessExperimental- : A 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, theCross-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.
- : A boolean value indicating whether the
cspExperimental- : Specifies the Content Security Policy that an embedded document must agree to enforce upon itself.
featurePolicyRead only Experimental- : Returns the
FeaturePolicyinterface which provides a simple API for introspecting the Permissions Policies applied to a specific document.
- : Returns the
frameBorderDeprecated- : A string that indicates whether to create borders between frames.
height- : A string that reflects the
heightHTML attribute, indicating the height of the frame.
- : A string that reflects the
loading- : A string providing a hint to the browser that the iframe should be loaded immediately (
eager) or on an as-needed basis (lazy). This reflects theloadingHTML attribute.
- : A string providing a hint to the browser that the iframe should be loaded immediately (
longDescDeprecated- : A string that contains the URI of a long description of the frame.
marginHeightDeprecated- : A string being the height of the frame margin.
marginWidthDeprecated- : A string being the width of the frame margin.
name- : A string that reflects the
nameHTML attribute, containing a name by which to refer to the frame.
- : A string that reflects the
privateTokenExperimental- : A string representation of an options object representing a private state token operation; this object has the same structure as the
RequestInitdictionary’sprivateTokenproperty. Mirrors the content of the associated<iframe>element’sprivateTokenattribute.
- : A string representation of an options object representing a private state token operation; this object has the same structure as the
referrerPolicy- : A string that reflects the
referrerPolicyHTML attribute indicating which referrer to use when fetching the linked resource.
- : A string that reflects the
sandboxRead only- : Returns a
DOMTokenListthat reflects thesandboxHTML attribute, indicating extra restrictions on the behavior of the nested content.
- : Returns a
scrollingDeprecated- : A string that indicates whether the browser should provide scrollbars for the frame.
src- : A string that reflects the
srcHTML attribute, containing the address of the content to be embedded. Note that programmatically removing an<iframe>’s src attribute (e.g., viaremoveAttribute()) causesabout:blankto be loaded in the frame in Firefox (from version 65), Chromium-based browsers, and Safari/iOS.
- : A string that reflects the
srcdoc- : A
TrustedHTMLor string that represents the HTML document loaded into the frame.
- : A
width- : A string that reflects the
widthHTML attribute, indicating the width of the frame.
- : A string that reflects the
Instance methods
Also inherits methods from its parent interface, HTMLElement.
getSVGDocument()- : Returns the embedded SVG as a
Document.
- : Returns the embedded SVG as a
Specifications
SpecificationsStandards references are available on the canonical MDN page.
Browser compatibility
Browser compatibilityCompatibility data is available on the canonical MDN page.
See also
- The HTML element implementing this interface:
<iframe>