Sets or retrieves the window or frame name.
Syntax
HTML <ELEMENT NAME = sName ... > Scripting object.name [ = sName ]
Possible Values
sName String that specifies one of the following values:
_blank Link is loaded into a new, unnamed window. _parent Link is loaded over the parent. If the frame has no parent, this value refers to _self. _self Page is replaced with the specified link. _top Link is loaded at the topmost level. name Arbitrary name used to identify the object. The property is read/write with no default value.
Expressions can be used in place of the preceding value(s), as of Microsoft® Internet Explorer 5. For more information, see Dynamic Properties.
Remarks
The name property identifies which frame displays the content of a linked document.
To access a window's name property, use the window keyword.
Example
This example assigns the name property to the window object.
Sample Code
window.name="MyWindow";This example uses scripting to set the name property of a frame.
Sample Code
parent.frames[0].name="Left";This example shows how the NAME attribute for a window can be persisted in HTML, but only when defined in a frame within a frameset.
Sample Code
<FRAMESET> <FRAME NAME="Left" SRC="blank.htm"> <FRAME NAME="Right" SRC="contents.htm"> </FRAMESET>This example uses the window's open method to assign the name property.
Sample Code
window.open("file.htm","Frame1");
Applies To
FRAME, IFRAME, window