Search w3schools.com:

SHARE THIS PAGE

Window parent Property

Window Object Reference Window Object

Definition and Usage

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

Syntax

window.parent


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The parent property is supported in all major browsers.


Example

Example

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

<html>
<head>
<script>
function openWin()
{
window.open('','','width=200,height=100');
alert(window.parent.location);
}
</script>
</head>
<body>

<input type="button" value="Open window" onclick="openWin()">

</body>
</html>

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]