- Attribute of
- <a> HTML Tag
- What does
<a target="" > HTML Attributedo?
- Specifies the context in which the linked resource will open.
<a href="/" target="_blank">The home page will open in another tab.</a>
Frames deprecated; only use
The only currently relevant value of
_blank. The other values of
target were used to specify specific frames. However, frames have been deprecated in HTML5.
target is specified, the link will open in the current context, unless the user or browser specifies otherwise.
a target=”_blank” Open in New Browser Tab (or Window)
target attribute specifies where the linked document will open when the link is clicked. The default is the current window. If
target="_blank", the linked document will open in a new tab or (on older browsers) a new window.
Why Open in a New Browser?
The most common reason to use
Some people argue that users do not prefer to open links in a new browsing context. They think that doing so is similar to popup ads and other annoying behavior. With the rise of tabbed browsing, this argument has largely gone away. Most users prefer to open links in a new tab, because it allows them to come queue referenced links for later reading without losing their current browsing context.
Values of the
|_blank||Opens the linked document in a new tab or window.|
|_parent||Opens the link in the parent frame. Frames are deprecated in HTML5.|
|_self||Open the link in the current frame.|
|_top||Opens the link in the top-most frame. Frames are deprecated in HTML5.|
|frame name||Opens the link in the named frame. Frames are deprecated in HTML5.|
All Attributes of the
|hreflang||Specifies the language of the linked resource.|
|download||Directs the browser to download the linked resource rather than opening it.|
|Specifies the context in which the linked resource will open.|
|title||text||Defines the title of a link, which appears to the user as a tooltip.|
|href||url||Specifies the linked document, resource, or location.|
Browser Support for target