opener property (window)
Sets or retrieves a reference to the window that opened the current document.
- If a document opens a page in a new browser window (for example, by an anchor element or the open method), then the opener property can be used in the child document to access the parent window object.
- If the current document is within a frame or iframe and you need the window that hosts the current window, use the parent property.
You can find the related objects in the Supported by objects section below.
This property is read/write.
Reference to the opener window.
Default: this property has no default value.
Example HTML code 1:
This example shows how to open a child window and communicate between the opener and the child window:
Did you find this example helpful?
User Contributed Comments