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:

  <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.

The table shows all available values for the target attribute.

_blankOpens the page in a new window.
_selfOpens the page in the same window where the link was clicked (the default value).
_parentOpens the page in the parent window.
_topOpens the page to the full screen.
frame_nameOpens 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).

Copying materials from this site is possible only with the permission of the site administration and
when you specify a direct active link to the source.
2011-2018 © | ruen