Click to return to the DHTML, HTML     
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="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

[ Object Name ]
PlatformVersion
Win16:
Win32:
Mac:
Unix:
WinCE:
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.