Window opener attribute
- Previous Page open()
- Next Page outerHeight
- Go to the Previous Level Window Object
Definition and usage
opener
Property returns a reference to the window that created the window.
If window xxx opens window yyy:
yyy.opener returns xxx.
yyy.opener.close() closes xxx.
See also:
Example
Open a window and write some text in this opener window:
const myWindow = window.open("", "", "width=300,height=300"); myWindow.opener.document.getElementById("demo").innerHTML = "HELLO!";
Syntax
window.opener
Return Value
Type | Description |
---|---|
Window | The Window That Created the Window. |
Browser Support
All Browsers Support window.opener
:
Chrome | IE | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
Chrome | IE | Edge | Firefox | Safari | Opera |
Support | Support | Support | Support | Support | Support |
- Previous Page open()
- Next Page outerHeight
- Go to the Previous Level Window Object