The Window.frameElement
property
returns the element (such as <object>
)
in which the window is embedded.
The Window.frameElement
property
returns the element (such as <object>
)
in which the window is embedded.
The element which the window is embedded into. If the window isn't embedded into
another document, or if the document into which it's embedded has a different
null
instead.
const frameEl = window.frameElement;
/ If we're embedded, change the containing element's URL to 'https://mozilla.org/'
if (frameEl) {
frameEl.src = "https://mozilla.org/";
}
Specification |
---|
HTML # dom-frameelement-dev |
BCD tables only load in the browser
window.frames
returns an array-like object, listing the direct
sub-frames of the current window.window.parent
returns the parent window, which is the window
containing the frameElement
of the child window.