Window parent 属性
- 前のページ pageYOffset
- 次のページ print()
- 上層階に戻る Windowオブジェクト
定義と使用方法
parent
属性は(現在のウィンドウの)親ウィンドウを返します。
parent
属性は読み取り専用です。
ヒント
parent
属性と top
属性が異なります。
window.parent
ウィンドウの直接の親を返します。
window.top
ウィンドウ階層の最上位のウィンドウを返します。
参照してください:
例
例 1
親の背景色を変更する:
parent.document.body.style.backgroundColor = "lightblue";
例 2
親ウィンドウの場所:
location = window.parent.location;
文法
window.parent
または:
parent
返り値
タイプ | 説明 |
---|---|
オブジェクト | 現在のウィンドウの親ウィンドウ。 |
ブラウザサポート
すべてのブラウザがサポートしています window.parent
:
Chrome | IE | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
Chrome | IE | Edge | Firefox | Safari | Opera |
サポート | サポート | サポート | サポート | サポート | サポート |
- 前のページ pageYOffset
- 次のページ print()
- 上層階に戻る Windowオブジェクト