Set the target attribute of the link to _blank:

<a href="#" target="_blank" rel="noopener noreferrer">Link</a>

For other examples, see here: http://www.w3schools.com/tags/att_a_target.asp


Note

I previously suggested blank instead of _blank because, if used, it'll open a new tab and then use the same tab if the link is clicked again. However, this is only because, as GolezTrol pointed out, it refers to the name a of a frame/window, which would be set and used when the link is pressed again to open it in the same tab.


Security Consideration!

The rel="noopener noreferrer" is to prevent the newly opened tab from being able to modify the original tab maliciously. For more information about this vulnerability read the following articles:

  • The target="_blank" vulnerability by example
  • External Links using target='_blank'
Answer from SharkofMirkwood on Stack Overflow
Discussions

Open a URL in a new tab (and not a new window)
Only want to open a url in new window or new tab. This is browser dependent. We do not need to bother about author. Please check that fiddle. It is working 2015-08-13T19:01:10.58Z+00:00 ... It is found that, it didn't work on js fiddle and plunker, but works when you create an html file. More on stackoverflow.com
🌐 stackoverflow.com
How to Open Page in New Tab
Need to add “target=“_blank” after your href attribute More on reddit.com
🌐 r/HTML
4
1
November 21, 2024
creating links that open in a new window.__
When using publisher to create web sites, I cannot figure out how to embed a link that will open in a new window. Is there an option for that? More on learn.microsoft.com
🌐 learn.microsoft.com
10
4
Using html button + javascript function to open links in new window - JavaScript - SitePoint Forums | Web Development & Design Community
Hi all, Im trying to set up a function where once a html button is pressed, a function checks a variable and redirects a link to a new window if the value comes back positive. This is the function I’m trying to get goi… More on sitepoint.com
🌐 sitepoint.com
0
August 1, 2018
🌐
W3Schools
w3schools.com › tags › tryit.asp
W3Schools online HTML editor
The W3Schools online code editor allows you to edit code and view the result in your browser
🌐
Wikihow
wikihow.com › computers and electronics › internet › internet browsers › how to open a new window: 4 easy ways
How to Open a New Window: 4 Easy Ways
June 4, 2025 - ... There is currently no setting in Google Chrome that controls this. You'll have to right-click on the link, and select "Open in new tab" or "Open in new window." Other browsers may allow you to specify options when a link is clicked.
🌐
W3Schools
w3schools.com › jsref › met_win_open.asp
Window open() Method
window.open("http://www.google.com/"); window.open("https://www.w3schools.com/"); Try it Yourself » · Open a new window.
🌐
Puenko
puenko.boutique › !w3fq3dgs › e0renarpioxq812688.xml
Html open a link in a new tab javascript code - puenko.boutique
Press "Allow" to confirm · I am not a Robot · Click on "Allow" to confirm that you are not a robot
Find elsewhere
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › API › Window › open
Window: open() method - Web APIs | MDN
The open() method of the Window interface loads a specified resource into a new or existing browsing context (that is, a tab, a window, or an iframe) under a specified name.
🌐
Microsoft Learn
learn.microsoft.com › en-us › answers › questions › 4765921 › creating-links-that-open-in-a-new-window
creating links that open in a new window.__ - Microsoft Q&A
(Insert > html code fragment) Here is the code snippet again: <script language="JavaScript" type="text/javascript"> function Show(Url, Name, Features) { window.open(Url, Name, Features); } </script> Move the code fragment box off to a corner or empty space on your page where it won't get in the way. This code fragment need to be on every page where you want to open links in a new window.
🌐
Atlassian
developer.atlassian.com › server › confluence › how-do-i-make-my-attachments-open-in-a-new-window-or-a-tab
How do I make my attachments open in a new window or a tab?
add the parameter TARGET = "_blank" to the <a href> HTML tag, which will cause the URL specified in the href parameter to open in a new window or a new tag depending upon the option set in the browser.
🌐
EncodedNA
encodedna.com › 2013 › 09 › javascript-window-open-method.htm
Open a New Browser Window using JavaScript open() Method
In addition, I have specified the URL or the page which is to be opened in the window. You can give the new a window a name, using this parameter. It works as an identifier meaning if a window has been opened with a specific name, then clicking the button again will refresh the already opened window showing new contents.
🌐
Electron
electronjs.org › browserwindow
BrowserWindow | Electron
Merges all windows into one window with multiple tabs when native tabs are enabled and there is more than one open window. Moves the current tab into a new window if native tabs are enabled and there is more than one tab in the current window.
🌐
SitePoint
sitepoint.com › javascript
Using html button + javascript function to open links in new window - JavaScript - SitePoint Forums | Web Development & Design Community
August 1, 2018 - Hi all, Im trying to set up a function where once a html button is pressed, a function checks a variable and redirects a link to a new window if the value comes back positive. This is the function I’m trying to get going: function launchTask() { window.open("https://www.google.com","_blank"); } and the button button type=“button” onclick=“LaunchTask()” Theres probably a basic solution i’m not seeing, can somebody help?
🌐
OutSystems
outsystems.com › forums › discussion › 65977 › open-link-in-a-new-window-not-tab
Open link in a new window (NOT TAB) | OutSystems
I have a link on my page, and I want it to open it in a new window (not a new tab) when clicking it. Currently, this link points to a new screen action, and in this new screen action I have a RunJavaScript server action with the following script: · However, it still open the link in new tab ...
🌐
freeCodeCamp
forum.freecodecamp.org › html-css
Onclick new window? - HTML-CSS - The freeCodeCamp Forum
February 18, 2022 - How to make this code open a new window: <! --- <button class="button" onclick="window.location.href='https://www.upwork.com/freelancers/michaelkiger';">Contact Owner</button> --->
🌐
RapidTables
rapidtables.com › web › html › link › html-link-new-window.html
HTML link in a new window
In order to open a link in a new window, add Javascript command onclick="window.open('text-link.htm', 'name','width=600,height=400') inside the <a> tag: <a href="../html-link.htm" target="popup" onclick="window.open('../html-link.htm','name','width=600,height=400')">Open page in new window</a>
🌐
HTML AM
html.am › html-codes › links › open-link-in-new-window.cfm
Open Link in New Window
This page explains and demonstrates how to create a link that opens in a new browser window. The quickest way to open a link in a new window is to add target="_blank" to your <a> tag (which of course, is the HTML tag to create a link).
🌐
Super Dev Resources
superdevresources.com › home › blog › development › how to open links in a popup window
How to Open Links in a Popup Window - Super Dev Resources
June 18, 2020 - Before you go all crazy with popup ... A link can be opened in a new window (or in a new tab) by simple adding the target="_blank" attribute to links like shown below....