|Property/method value type:||String primitive|
|-||myWindow.name = aString|
|-||name = aString|
|-||window.open(aURL, aName, ...)|
|HTML syntax:||<FRAME NAME="..."> Window.open(...)|
|Argument list:||aName||A name for the window|
|aString||A string value containing the new name for the window|
|aURL||A URL to load into the window|
This name value can be used with the target attribute of the HTML <A> anchor tag or the <FORM> tag.
The name of a window can be set when the window is created with the open() method. It is also assigned by the NAME="..." HTML tag attribute of a <FRAME> tag.
The example shows the window name being modified. Reload to see the persistence effect. Load another document and then load this script again to see how the name persists through intermediate document loads.
This is not the title text for the window.
Note that the name value persists through document loads and so you may need to be careful if you are using the name property in a document script. It might have been set by an earlier page. This also suggests that other window properties may be persistent between documents and might provide a way to pass messages between pages and maintain state during a session.
<HTML> <HEAD> </HEAD> <BODY> <SCRIPT> document.write("***"+window.name+"<BR>"); window.name = "FRED"; document.write("***"+window.name+"<BR>"); </SCRIPT> </BODY> </HTML>