Search w3schools.com:

SHARE THIS PAGE

Window name Property

Window Object Reference Window Object

Definition and Usage

The name property sets or returns the name of the window.

Syntax

window.name


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The name property is supported in all major browsers.


Example

Example

Return the name of the new window:

<html>
<head>
<script>
function openWin()
{
myWindow=window.open('','MsgWindow','width=200,height=100');
myWindow.document.write("<p>This window's name is: " + myWindow.name + "</p>");
}
</script>
</head>
<body>

<input type="button" value="Open 'myWindow'" 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]