THE WORLD'S LARGEST WEB DEVELOPER SITE

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

SHARE THIS PAGE






Search w3schools.com:

Translate w3schools.com: