Easy Tutorial
❮ Prop Style Maxheight Prop Script Async ❯

Window parent Property


Definition and Usage

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

Syntax


Browser Support

All major browsers support the parent property.


Example

When a new window is opened, an alert is shown in the parent window:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>tutorialpro.org(tutorialpro.org)</title>
</head>
<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>

❮ Prop Style Maxheight Prop Script Async ❯