asp.net.ph

Skip Navigation Links

NAME Attribute | name Property

Language References


Sets or retrieves the name of a window or the frame so it can be targeted from links in other documents.

Syntax


Inline <element NAME = sName...>
Script object.name = sName ]

Possible Values


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.

Remarks

To access a window's name property, use the window keyword.

Example

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.

Applies To

FRAME, IFRAME, window



© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note