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:

The top Property


Syntax

window.parent
or just:
parent

Return Value

Type Description
An objectThe parent window of the current window.

More Examples

The location of the parent window:

location = window.parent.location;
Try it Yourself »

Browser Support

window.parent is supported in all browsers:

Chrome Edge Firefox Safari Opera IE
Yes Yes Yes Yes Yes Yes


Copyright 1999-2023 by Refsnes Data. All Rights Reserved.