Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Window opener property

Window opener property

Window Object Reference Window Object


Definition and Usage

The opener property is a readable and writable property that returns a reference to the Window object that created this window.

When you open a window with window.open(), you can use this property to return details about the source (parent) window of the target window.

Code hint: window.opener.close() will close the source (parent) window.

Syntax

window.opener


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the opener property


Example

Example

Write text to the opener window (parent window):

Runoob Tutorial(runoob.com)

Try it »


Window Object Reference Window Object