Window parent property
- Previous Page pageYOffset
- Next Page print()
- Go Up One Level Window Object
Definition and usage
parent
The property returns the parent window (of the current window).
parent
The property is read-only.
Hint
parent
The property is top
The properties are different.
window.parent
Returns the direct parent of the window.
window.top
Returns the top-level window in the window hierarchy.
See also:
Instance
Example 1
Change the background color of the parent:
parent.document.body.style.backgroundColor = "lightblue";
Example 2
Position of the parent window:
location = window.parent.location;
Syntax
window.parent
Or:
parent
Return Value
Type | Description |
---|---|
Object | The parent window of the current window. |
Browser Support
All Browsers Support window.parent
:
Chrome | IE | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
Chrome | IE | Edge | Firefox | Safari | Opera |
Support | Support | Support | Support | Support | Support |
- Previous Page pageYOffset
- Next Page print()
- Go Up One Level Window Object