Window parent
Example
Change the background-color of the parent:
parent.document.body.style.backgroundColor = "lightblue";
Try it Yourself »
Description
The parent
property returns the parent window (of the current window).
The parent
property is read-only.
Note
The parent
property is not the same as the
top
property.
window.parent
returns the immediate parent of a window.
window.top
returns the topmost window in the hierarchy of windows.
See Also:
Syntax
window.parent
or just:
parent
Return Value
Type | Description |
An object | The parent window of the current window. |
More Examples
Browser Support
window.parent
is supported in all browsers:
Chrome | Edge | Firefox | Safari | Opera | IE |
Yes | Yes | Yes | Yes | Yes | Yes |