| ★ wanayoo — archive 1999 http://www.msdn.microsoft.com/workshop/author/dhtml/reference/properties/name_0.asp | Nouvelle recherche | Portail wanayoo |
![]() |
![]() |
All Products | Support | Search | microsoft.com Home |
![]() | ||
| HOME | VOICES | LIBRARIES | COMMUNITY | DOWNLOADS | SITE GUIDE | SEARCH MSDN | ||
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="/old?u=http%3A%2F%2Fwww.msdn.microsoft.com%2Fworkshop%2Fauthor%2Fdhtml%2Freference%2Fproperties%2Fblank.htm&y=1999"> <FRAME NAME="Right" SRC="/old?u=http%3A%2F%2Fwww.msdn.microsoft.com%2Fworkshop%2Fauthor%2Fdhtml%2Freference%2Fproperties%2Fcontents.htm&y=1999"> </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