Open link in new tab in HTML
To open the page in a new window, you need to tell the browser the name of the window in which you want to open the page. If you do not specify the browser to use a certain window, it will open the page in the current window.
To tell the browser that when opening a page, you need to use a different window, instead of the current one, add the target
attribute to the <a>
element. Its value tells the browser about the target window for the page. If you use _blank
as the attribute value, then the browser for each page will always open a new window:
<p> <a href="mypage.html" target="_blank">Other page</a>. If you set the target attribute to _blank, then the link will open in a new window. </p>
The table shows all available values for the target
attribute.
Value | Description |
---|---|
_blank | Opens the page in a new window. |
_self | Opens the page in the same window where the link was clicked (the default value). |
_parent | Opens the page in the parent window. |
_top | Opens the page to the full screen. |
frame_name | Opens the page in the specified frame. |
Note: if your browser supports tabs, the links with target="_ blank"
will not open in a new window, but in a new tab. In this case, if you want the link to open a new window, you need to use the programming language (for example, JavaScript).
With this theme look: