Movatterモバイル変換


[0]ホーム

URL:


MDN Web Docs

Window: frameElement property

BaselineWidely available

TheWindow.frameElement propertyreturns the element (such as<iframe> or<object>)in which the window is embedded.

Note:Despite this property's name, it works for documents embeddedwithin any embedding point, including<object>,<iframe>, or<embed>.

Value

The element which the window is embedded into. If the window isn't embedded intoanother document, or if the document into which it's embedded has a differentorigin, the value isnull instead.

Examples

js
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/";}

Specifications

Specification
HTML
# dom-frameelement-dev

Browser compatibility

See also

  • window.frames returns an array-like object, listing the directsub-frames of the current window.
  • window.parent returns the parent window, which is the windowcontaining theframeElement of the child window.

Help improve MDN

Learn how to contribute.

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp