name property (window)
Sets or retrieves the name of the current window object, which is used to identify the window.
With the name property, the name of a window can be modified, after the window has been created. It is also possible to specify the initial name of a newly created window.
- When a window is opened by an anchor, then the target property specifies the initial name of the created window. For details, see Example 1 or the page for the target property.
- When a window belongs to a frame or iframe element, then the name property sets the initial name of the contained window. See Example 2 for details.
- Finally, if a window is created dynamically by the open method, then the second parameter of the method specifies the initial name of the created window. See Example 3 for details.
You can find the related objects in the Supported by objects section below.
This property is read/write.
String that specifies or retrieves the name of the window.
Default: this property has no default value.
Example HTML code 1:
This example shows how to create named windows with anchor elements:
Example HTML code 2:
This example illustrates named windows inside iframe objects:
Example HTML code 3:
This example illustrates the use of the open method for creating named windows:
User Contributed Comments