Window parent Property

Window Object Reference Window Object

Example

Change the background-color of an <iframe> element's parent document:

parent.document.body.style.backgroundColor = "red";

Try it yourself »


Definition and Usage

The parent property returns the parent window of the current window.

This property is read-only.


Browser Support

Property
parent Yes Yes Yes Yes Yes


Syntax

window.parent

Technical Details

Return Value: The parent window object of the current window


Examples

More Examples

Example

Alert the location of the parent window when opening a new window:

window.open("", "", "width=200, height=100");
alert(window.parent.location);

Try it yourself »


Window Object Reference Window Object

Color Picker

colorpicker