window.name

JavaScript1.0+, JScript1.0+ Nav2+, IE3+, Opera3+ Syntax

							window.name

Description

The name property of an instance of a Window object returns the name of the window. This property contains the name specified when new windows are created using the Window.open() method. In JavaScript 1.0, this property was read only, but this was changed in JavaScript 1.1 so you can assign a name to a window not created with the Window.open() method. This property was tainted in JavaScript 1.1 as well.

Example

Listing 7.554 has a button that launches a second window. The name of the window is written to it using the name property of the Window object.

Listing 7.554 Using the name Property to Retrieve the Name of a Window
 <html> <head> <script ...

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.