★ wanayoo — archive 1999 http://www.msdn.microsoft.com/workshop/author/dhtml/reference/properties/name_0.aspNouvelle recherche | Portail wanayoo
MSDN Online Web Workshop   All Products  |   Support  |   Search  |   microsoft.com Home  
microsoft.com Home
  HOME  |   VOICES  |   LIBRARIES  |   COMMUNITY  |   DOWNLOADS  |   SITE GUIDE  |   SEARCH MSDN
 
Click to return to the DHTML, HTML & CSS home page  
MULTIPLE Attribute | mult...     NAME Attribute | name Pro...     DHTML Properties    
Web Workshop  |  DHTML, HTML & CSS

NAME Attribute | name Property


Sets or retrieves the window or frame name.

Syntax

HTML<ELEMENT NAME = sName ... >
Scriptingobject.name [ = sName ]

Possible Values

sName String that specifies one of the following values:
_blankLink is loaded into a new, unnamed window.
_parentLink is loaded over the parent. If the frame has no parent, this value refers to _self.
_selfPage is replaced with the specified link.
_topLink is loaded at the topmost level.
nameArbitrary 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



Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.