Latest web development tutorials

Window name attribute

Window Object Reference Window object

Definition and Usage

name property sets or returns the name of the store window of a string.

grammar

window.name


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

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>

try it"


Window Object Reference Window object