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.
Inherits properties from its parent, HTMLElement
.
HTMLIFrameElement.align
DOMString
that specifies the alignment of the frame with respect to the surrounding context.HTMLIFrameElement.allow
self
and src
which represent the origin in the iframe's src attribute. The default value is src
.HTMLIFrameElement.allowfullscreen
Boolean
indicating whether the inline frame is willing to be placed into full screen mode. See Using full-screen mode for details.HTMLIFrameElement.allowPaymentRequest
Boolean
indicating whether the Payment Request API may be invoked inside a cross-origin iframe.HTMLIFrameElement.contentDocument
Read only
Document
, the active document in the inline frame's nested browsing context.HTMLIFrameElement.contentWindow
Read only
WindowProxy
, the window proxy for the nested browsing context.HTMLIFrameElement.csp
HTMLIFrameElement.frameBorder
DOMString
that indicates whether to create borders between frames.HTMLIFrameElement.height
DOMString
that reflects the height
HTML attribute, indicating the height of the frame.HTMLIFrameElement.longDesc
DOMString
that contains the URI of a long description of the frame.HTMLIFrameElement.marginHeight
DOMString
being the height of the frame margin.HTMLIFrameElement.marginWidth
DOMString
being the width of the frame margin.HTMLIFrameElement.name
DOMString
that reflects the name
HTML attribute, containing a name by which to refer to the frame.HTMLIFrameElement.policy
Read only
Policy
interface which provides a simple API for introspecting the feature policies applied to a specific document.HTMLIFrameElement.referrerPolicy
DOMString
that reflects the referrerpolicy
HTML attribute indicating which referrer to use when fetching the linked resource.HTMLIFrameElement.sandbox
DOMSettableTokenList
that reflects the sandbox
HTML attribute, indicating extra restrictions on the behavior of the nested content.HTMLIFrameElement.scrolling
DOMString
that indicates whether the browser should provide scrollbars for the frame.HTMLIFrameElement.src
DOMString
that reflects the src
HTML attribute, containing the address of the content to be embedded.HTMLIFrameElement.srcdoc
DOMString
that represents the content to display in the frame.HTMLIFrameElement.width
DOMString
that reflects the width
HTML attribute, indicating the width of the frame.Inherits properties from its parent, HTMLElement
.
Specification | Status | Comment |
---|---|---|
HTML Living Standard The definition of 'HTMLIFrameElement' in that specification. | Living Standard | The following property has been added: allowFullscreen . |
HTML5 The definition of 'HTMLIFrameElement' in that specification. | Recommendation | The following properties are now obsolete: scrolling , marginWidth , marginHeight , longDesc , frameBorder , and align .The following properties have been added: srcdoc , sandbox , and contentWindow . |
Document Object Model (DOM) Level 2 HTML Specification The definition of 'HTMLIFrameElement' in that specification. | Obsolete | The contentDocument property has been added. |
Document Object Model (DOM) Level 1 Specification The definition of 'HTMLIFrameElement' in that specification. | Obsolete | Initial definition. |
Desktop | ||||||
---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
Basic support | Yes | Yes | 1 | Yes | Yes | Yes |
addNextPaintListener
|
No | No | 47
|
No | No | No |
align
|
43 | Yes | Yes | ? | Yes | 6 |
allow |
60 | ? | ? | ? | 53 | ? |
allowFullScreen
|
17
|
Yes | 18
|
No | No | No |
allowPaymentRequest
|
60
|
15 | 56 | ? | No | ? |
clearMatch
|
No | No | 47
|
No | No | No |
contentDocument |
43 | Yes | Yes | 8 | Yes | 10 |
contentWindow |
43 | Yes | Yes | Yes | Yes | 6 |
csp
|
61 | ? | ? | ? | 48 | ? |
download
|
No | No | 47
|
No | No | No |
executeScript
|
No | No | 47
|
No | No | No |
findAll
|
No | No | 47
|
No | No | No |
findNext
|
No | No | 47
|
No | No | No |
frameBorder
|
43 | Yes | Yes | ? | Yes | 6 |
getActive
|
No | No | 47
|
No | No | No |
getCanGoBack
|
No | No | 47
|
No | No | No |
getCanGoForward
|
No | No | 47
|
No | No | No |
getContentDimensions
|
No | No | 47
|
No | No | No |
getManifest
|
No | No | 47
|
No | No | No |
getMuted
|
No | No | 47
|
No | No | No |
getScreenshot
|
No | No | 47
|
No | No | No |
getStructuredData
|
No | No | 47
|
No | No | No |
getVisible
|
No | No | 47
|
No | No | No |
getVolume
|
No | No | 47
|
No | No | No |
goBack
|
No | No | 47
|
No | No | No |
goForward
|
No | No | 47
|
No | No | No |
height |
43 | Yes | Yes | ? | Yes | 6 |
longDesc
|
43 | Yes | Yes | ? | Yes | 6 |
marginHeight
|
43 | Yes | Yes | ? | Yes | 6 |
marginWidth
|
43 | Yes | Yes | ? | Yes | 6 |
mute
|
No | No | 47
|
No | No | No |
name |
43 | Yes | Yes | ? | Yes | 6 |
policy
|
69
|
No | No | No | 56
|
No |
purgeHistory
|
No | No | 47
|
No | No | No |
referrerPolicy |
51 | No | 50 | No | 38 | 11.1 |
reload
|
No | No | 47
|
No | No | No |
removeNextPaintListener
|
No | No | 47
|
No | No | No |
sandbox |
43
|
Yes | 17
|
? | Yes
|
6 |
scrolling
|
43 | Yes | Yes | ? | Yes | 6 |
sendMouseEvent
|
No | No | 47
|
No | No | No |
sendTouchEvent
|
No | No | 47
|
No | No | No |
setActive
|
No | No | 47
|
No | No | No |
setNfcFocus
|
No | No | No
|
No | No | No |
setVisible
|
No | No | 47
|
No | No | No |
setVolume
|
No | No | 47
|
No | No | No |
src |
43 | Yes | Yes | ? | ? | 6 |
srcdoc |
43 | Yes | 25 | No | ? | 6 |
stop
|
No | No | 47
|
No | No | No |
unmute
|
No | No | 47
|
No | No | No |
width |
43 | Yes | Yes | ? | Yes | 6 |
zoom
|
No | No | 47
|
No | No | No |
Mobile | |||||||
---|---|---|---|---|---|---|---|
Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
Basic support | Yes | Yes | Yes | 4 | Yes | ? | ? |
addNextPaintListener
|
No | No | No | No | No | No | ? |
align
|
Yes | Yes | ? | ? | Yes | ? | ? |
allow |
66 | 66 | ? | ? | 53 | ? | ? |
allowFullScreen
|
Yes
|
18
|
Yes | 18
|
No | ? | ? |
allowPaymentRequest
|
No | 61
|
? | ? | No | ? | ? |
clearMatch
|
No | No | No | No | No | No | ? |
contentDocument |
Yes | Yes | ? | 4 | Yes | Yes | ? |
contentWindow |
Yes | Yes | Yes | Yes | Yes | Yes | ? |
csp
|
61 | 61 | ? | ? | 48 | ? | ? |
download
|
No | No | No | No | No | No | ? |
executeScript
|
No | No | No | No | No | No | ? |
findAll
|
No | No | No | No | No | No | ? |
findNext
|
No | No | No | No | No | No | ? |
frameBorder
|
Yes | Yes | ? | ? | Yes | ? | ? |
getActive
|
No | No | No | No | No | No | ? |
getCanGoBack
|
No | No | No | No | No | No | ? |
getCanGoForward
|
No | No | No | No | No | No | ? |
getContentDimensions
|
No | No | No | No | No | No | ? |
getManifest
|
No | No | No | No | No | No | ? |
getMuted
|
No | No | No | No | No | No | ? |
getScreenshot
|
No | No | No | No | No | No | ? |
getStructuredData
|
No | No | No | No | No | No | ? |
getVisible
|
No | No | No | No | No | No | ? |
getVolume
|
No | No | No | No | No | No | ? |
goBack
|
No | No | No | No | No | No | ? |
goForward
|
No | No | No | No | No | No | ? |
height |
Yes | Yes | ? | ? | Yes | ? | ? |
longDesc
|
Yes | Yes | ? | ? | Yes | ? | ? |
marginHeight
|
Yes | Yes | ? | ? | Yes | ? | ? |
marginWidth
|
Yes | Yes | ? | ? | Yes | ? | ? |
mute
|
No | No | No | No | No | No | ? |
name |
Yes | Yes | ? | ? | Yes | ? | ? |
policy
|
No | 69
|
No | No | 56
|
No | ? |
purgeHistory
|
No | No | No | No | No | No | ? |
referrerPolicy |
51 | 51 | No | 50 | 38 | No | ? |
reload
|
No | No | No | No | No | No | ? |
removeNextPaintListener
|
No | No | No | No | No | No | ? |
sandbox |
Yes
|
18
|
Yes | 17
|
Yes
|
? | ? |
scrolling
|
Yes | Yes | ? | ? | Yes | ? | ? |
sendMouseEvent
|
No | No | No | No | No | No | ? |
sendTouchEvent
|
No | No | No | No | No | No | ? |
setActive
|
No | No | No | No | No | No | ? |
setNfcFocus
|
No | No | No | No | No | No | ? |
setVisible
|
No | No | No | No | No | No | ? |
setVolume
|
No | No | No | No | No | No | ? |
src |
Yes | Yes | ? | ? | ? | ? | ? |
srcdoc |
Yes | 18 | Yes | 25 | ? | ? | ? |
stop
|
No | No | No | No | No | No | ? |
unmute
|
No | No | No | No | No | No | ? |
width |
Yes | Yes | ? | ? | Yes | ? | ? |
zoom
|
No | No | No | No | No | No | ? |
<iframe>
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement