Gets/sets the name of the window's browsing context.


string =; = string;


    // Open a tab with a specific browsing context name
    const otherTab ="url1", "_blank");
    if (otherTab) = "other-tab";
<a href="url2" target="other-tab">This link will be opened in the other tab.</a>


The name of the window is used primarily for setting targets for hyperlinks and forms. Browsing contexts do not need to have names.

It has also been used in some frameworks for providing cross-domain messaging (e.g., SessionVars and Dojo's as a more secure alternative to JSONP. Modern web applications hosting sensitive data should, however, not rely on for cross-domain messaging but instead utilize the postMessage API. will convert all values to their string representations by using the toString method.


Specification Status Comment
HTML Living Standard
The definition of '' in that specification.
Living Standard
The definition of '' in that specification.

Browser compatibility

ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
nameChrome Full support YesEdge Full support 12Firefox Full support YesIE ? Opera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes


Full support
Full support
Compatibility unknown
Compatibility unknown