Window name Property
Window Object
Definition and Usage
The name property sets or returns the name of the window.
Syntax
Browser Support

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
Thank You For Helping Us!
Your message has been sent to W3Schools.
Close [X]