window.top
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
ウィンドウ階層における最上位のウィンドウへの参照を返します。
構文
var topWindow = window.top;
注記
window.parent
プロパティは、現在のウィンドウの直近の親を返しますが、window.top
は、ウィンドウオブジェクトの階層における最上位のウィンドウを返します。
このプロパティは、親、あるいは、階層になっているウィンドウのサブフレーム内にあるウィンドウを扱っていて、最上位のフレームセットを取得したいときに特に役立ちます。
仕様
Specification |
---|
HTML # dom-top-dev |
ブラウザー互換性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
top |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- See implementation notes.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.