X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY ANGULAR BOOTSTRAP XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

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

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE

facebook