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.
Properties
Inherits properties from its parent, HTMLElement.
HTMLIFrameElement.align-
A string that specifies the alignment of the frame with respect to the surrounding context.
HTMLIFrameElement.allow-
A list of origins the frame is allowed to display content from. This attribute also accepts the values
selfandsrcwhich represent the origin in the iframe's src attribute. The default value issrc. HTMLIFrameElement.allowfullscreen-
A boolean value indicating whether the inline frame is willing to be placed into full screen mode. See Using fullscreen mode for details.
HTMLIFrameElement.allowPaymentRequest-
A boolean value indicating whether the Payment Request API may be invoked inside a cross-origin iframe.
HTMLIFrameElement.contentDocumentRead only-
Returns a
Document, the active document in the inline frame's nested browsing context. HTMLIFrameElement.contentWindowRead only-
Returns a
WindowProxy, the window proxy for the nested browsing context. HTMLIFrameElement.csp-
Specifies the Content Security Policy that an embedded document must agree to enforce upon itself.
HTMLIFrameElement.fetchpriority-
An optional
DOMStringrepresenting a hint given to the browser on how it should prioritize fetching of the iframe document relative to other iframe documents. If this value is provided, it must be one of the possible permitted values:highto fetch at a high priority,lowto fetch at a low priority, orautoto indicate no preference (which is the default). HTMLIFrameElement.frameBorder-
A string that indicates whether to create borders between frames.
HTMLIFrameElement.height-
A string that reflects the
heightHTML attribute, indicating the height of the frame. HTMLIFrameElement.longDesc-
A string that contains the URI of a long description of the frame.
HTMLIFrameElement.marginHeight-
A string being the height of the frame margin.
HTMLIFrameElement.marginWidth-
A string being the width of the frame margin.
HTMLIFrameElement.name-
A string that reflects the
nameHTML attribute, containing a name by which to refer to the frame. HTMLIFrameElement.featurePolicyRead only-
Returns the
FeaturePolicyinterface which provides a simple API for introspecting the feature policies applied to a specific document. HTMLIFrameElement.referrerPolicy-
A string that reflects the
referrerpolicyHTML attribute indicating which referrer to use when fetching the linked resource. HTMLIFrameElement.sandbox-
A
DOMTokenListthat reflects thesandboxHTML attribute, indicating extra restrictions on the behavior of the nested content. HTMLIFrameElement.scrolling-
A string that indicates whether the browser should provide scrollbars for the frame.
HTMLIFrameElement.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. viaElement.removeAttribute()) causesabout:blankto be loaded in the frame in Firefox (from version 65), Chromium-based browsers, and Safari/iOS. HTMLIFrameElement.srcdoc-
A string that represents the content to display in the frame.
HTMLIFrameElement.width-
A string that reflects the
widthHTML attribute, indicating the width of the frame.
Methods
Inherits properties from its parent, HTMLElement.
Specifications
| Specification |
|---|
| HTML Standard # htmliframeelement |
Browser compatibility
BCD tables only load in the browser
See also
- The HTML element implementing this interface:
<iframe>