Window name attribute
Definition and Usage
name property sets or returns the name of the store window of a string.
grammar
window.name
Browser Support
All major browsers support attribute name
Examples
Examples
Returns the name of the new window:
<! DOCTYPE html>
<Html>
<Head>
<Meta charset = "utf-8">
<Title> This tutorial (w3big.com) </ title>
<Script>
var myWindow;
function openWin () {
myWindow = window.open ( '', 'MsgWindow', 'width = 200, height = 100');
myWindow.document.write ( "<p> Window name:" + myWindow.name + "</ p>");
}
</ Script>
</ Head>
<Body>
<Input type = "button" value = "open my window" onclick = "openWin ()" />
</ Body>
</ Html>
<Html>
<Head>
<Meta charset = "utf-8">
<Title> This tutorial (w3big.com) </ title>
<Script>
var myWindow;
function openWin () {
myWindow = window.open ( '', 'MsgWindow', 'width = 200, height = 100');
myWindow.document.write ( "<p> Window name:" + myWindow.name + "</ p>");
}
</ Script>
</ Head>
<Body>
<Input type = "button" value = "open my window" onclick = "openWin ()" />
</ Body>
</ Html>
try it"
Window object