Easy Tutorial
❮ Event Ctrlkey Jsref Regexp Charset Not ❯

Window name Property


Definition and Usage

The name property sets or returns a string that contains the name of the window.

Syntax


Browser Support

All major browsers support the name property.


Example

Return the name of the new window:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>tutorialpro.org(tutorialpro.org)</title>
<script>
var myWindow;
function openWin(){
    myWindow=window.open('','MsgWindow','width=200,height=100');
    myWindow.document.write("<p>Window name is: " + myWindow.name + "</p>");
}
</script>
</head>
<body>

<input type="button" value="Open My Window" onclick="openWin()" />

</body>
</html>

❮ Event Ctrlkey Jsref Regexp Charset Not ❯