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

Window parent Property

Window Object Reference Window Object

Example

Change the background-color of an iframe'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.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The parent property is supported in all major browsers.


Syntax

window.parent

Technical Details

Return Value: The parent window of the current window


More Examples

Example

Alert the location of the parent window when opening the 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 BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates FREE Website Templates Free HTML Templates

SHARE THIS PAGE

facebook