The name of the window either from the <FRAME> tag, the method call or an assignment to this property.


DOM level - 1
JavaScript - 1.0
JScript - 1.0
Internet Explorer - 3.02
Netscape - 2.0
Opera - 3.0
Property/method value type:String primitive
JavaScript = aString
-name = aString, aName, ...)
HTML syntax:<FRAME NAME="...">
Argument list:aNameA name for the window
aStringA string value containing the new name for the window
aURLA 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.

At version 1.0 of JavaScript this is a read-only property.

JavaScript version 1.1 introduces the capability of changing the name of a window and makes this property writable. This is particularly useful because the initial window has no name and cannot be targeted directly until it has. You can fix this with an onLoad handler.

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.


Example code:

   document.write("***""<BR>"); = "FRED";

See also:Frame object,, NAME="...", Window object,