Window opener Property
Write some text to the source (parent) window:
myWindow.document.write("<p>This is 'myWindow'</p>"); // Text in the new window
myWindow.opener.document.write("<p>This is the source window!</p>"); // Text in the window that created the new window
Try it yourself »
Definition and Usage
The opener property returns a reference to the window that created the window.
When opening a window with the window.open() method, you can use this property from the destination window to return details of the source (parent) window.
Coding Tip: window.opener.close() will close the source (parent) window.
The opener property is supported in all major browsers.
|Return Value:||A reference to the window that created the window|
Thank You For Helping Us!
Your message has been sent to W3Schools.