Language References
Sets or retrieves the name of a window or the frame so it can be targeted from links in other documents.
Inline |
<element NAME = sName...> |
Script |
object.name = sName ] |
sName |
String that specifies a frame. |
_blank |
Loads the link into a new, unnamed window. |
_parent |
Loads the link over the parent. If the frame has no parent, this value refers to _self. |
_self |
Replaces the page with the specified link. |
_top |
Loads the link at the topmost level. |
The property is read/write with no default value.
To access a window's name property, use the window keyword.
The following code assigns the name property to the window object.
window.name "mainWin';
The name attribute for a window can also refer to a FRAME within a frameset.
<frameset>
<FRAME name='navFrame' src="menu.html">
<FRAME name='mainFrame' src="contents.html">
</frameset>
The name of a FRAME element can also be assigned dynamically.
parent.frames [ 0 ] .name "left';
The name property can also be assigned using the window's open method.
window.open ( "file.aspx","windowName" );
Note that names assigned to windows and frames are case-sensitive. They must be referenced as defined when used as the target of a link. If a specified target name does not exist, the link opens a new window.
FRAME, IFRAME, window