English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
nameSet or return the window name attribute.
After creating a window, this property is usually used to modify the window name.
The window name is mainly used to set the target of hyperlinks and forms. Windows do not need a name.
Return name attribute:
window.name
Set Name Property:
window.name = string
var win = window.open("", "popupWindow", "width=300, height=200"); win.document.write("<p>This window"39;s name is: " + win.name + "</p>Test and See‹/›
All browsers fully support the name property:
Property | |||||
name | Yes | Yes | Yes | Yes | Yes |
Value | Description |
---|---|
string | Specify the window name |
Return Value: | A string representing the window name |
---|
Set the name of the current window to "myWindow":
window.name = "myWindow";Test and See‹/›
Window (Window) Reference:window.open() method
Window (Window) Reference:window.close() method