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
๐ŸŒ
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
People also ask

How do I make my HTML link open in a new tab?
Use the target="_blank" attribute in the anchor tag along with rel="noopener noreferrer" for security.
๐ŸŒ
dhiwise.com
dhiwise.com โ€บ post โ€บ html-open-link-in-new-tab-improve-user-navigation
How to Open Links in a New Tab Safely in HTML
What is target="_blank" in HTML?
It instructs the browser to open the link in a new tab or new window.
๐ŸŒ
dhiwise.com
dhiwise.com โ€บ post โ€บ html-open-link-in-new-tab-improve-user-navigation
How to Open Links in a New Tab Safely in HTML
Should I use rel="noopener noreferrer"?
Yes, to prevent security vulnerabilities like tabnabbing and to avoid sending referrer information.
๐ŸŒ
dhiwise.com
dhiwise.com โ€บ post โ€บ html-open-link-in-new-tab-improve-user-navigation
How to Open Links in a New Tab Safely in HTML
๐ŸŒ
DhiWise
dhiwise.com โ€บ post โ€บ html-open-link-in-new-tab-improve-user-navigation
How to Open Links in a New Tab Safely in HTML
September 12, 2025 - This guide explains the rel="noopener noreferrer" security practice, preventing tabnabbing, with practical HTML and JavaScript examples to improve user experience without risking vulnerabilities.
๐ŸŒ
CoreUI
coreui.io โ€บ blog โ€บ how-to-open-link-in-a-new-tab-in-html
How to Open Link in a New Tab in HTML? ยท CoreUI
February 26, 2025 - Explore your browserโ€™s settings to see how it handles open link actions by default. Experiment with dynamically changing the target="_blank" using JavaScript if you want to create or insert conditions under which links open in a new tab.
๐ŸŒ
freeCodeCamp
freecodecamp.org โ€บ news โ€บ how-to-use-html-to-open-link-in-new-tab
How to Use HTML to Open a Link in a New Tab
September 8, 2020 - If you click on the link above, the browser will open the link in the current window or tab. This is the default behavior in every browser. To open a link in a new tab, we'll need to look at some of the other attributes of the anchor element's other attributes.
๐ŸŒ
Educative
educative.io โ€บ answers โ€บ how-to-open-a-link-in-a-new-tab-with-html-and-javascript
How to open a link in a new tab with HTML and JavaScript
The value of the target attribute _blank opens the link in a new tab. The text Educative is the link text between the opening <a> tag and the closing </a> tag. Enhance your understanding of HTML links with the help of this project, "Creating ...
Find elsewhere
๐ŸŒ
Equalize Digital
equalizedigital.com โ€บ home โ€บ link opens new window or tab
Link Opens New Window or Tab
August 28, 2025 - A link that opens a new window ... new windows or tabs include target="_blank" in the <a> tag, which tells the browser to open the new window or tab rather than following the link in the current tab.
๐ŸŒ
W3Schools
w3schools.com โ€บ tags โ€บ att_a_target.asp
HTML a target Attribute
<!--> <!DOCTYPE> <a> <abbr> <acronym> <address> <applet> <area> <article> <aside> <audio> <b> <base> <basefont> <bdi> <bdo> <big> <blockquote> <body> <br> <button> <canvas> <caption> <center> <cite> <code> <col> <colgroup> <data> <datalist> <dd> <del> <details> <dfn> <dialog> <dir> <div> <dl> <dt> <em> <embed> <fieldset> <figcaption> <figure> <font> <footer> <form> <frame> <frameset> <h1> - <h6> <head> <header> <hgroup> <hr> <html> <i> <iframe> <img> <input> <ins> <kbd> <label> <legend> <li> <link> <main> <map> <mark> <menu> <meta> <meter> <nav> <noframes> <noscript> <object> <ol> <optgroup> <
๐ŸŒ
freeCodeCamp
freecodecamp.org โ€บ news โ€บ how-to-open-a-link-in-a-new-tab
How to Open a Link in a New Tab โ€“ HTML target blank Attribute Explained
May 31, 2022 - In this example, we are linking to the DevDocs documentation, so the user can stay on their current page and look up a reference on a new tab. You can use the target="_blank" attribute if you want your users to click on a link that opens up ...
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ html โ€บ how-to-open-a-hyperlink-in-another-window-or-tab-in-html
How to Open a Hyperlink in Another Window or Tab in HTML? - GeeksforGeeks
November 23, 2024 - In HTML, this can be easily achieved using the 'target' attribute of the anchor ('<a>') tag. By setting 'target="_blank"', you instruct the browser to open the linked document in a new tab or window.
๐ŸŒ
W3Things
w3things.com โ€บ blog โ€บ open-external-links-in-new-tab-javascript
Open External Links in a New Tab Using JavaScript
December 6, 2023 - Beginners' tutorial on how to open external links in a new tab or browser window using pure JavaScript code.
๐ŸŒ
Quora
quora.com โ€บ How-do-you-create-a-hyperlink-that-opens-in-a-new-tab
How to create a hyperlink that opens in a new tab - Quora
Answer: to let your given link open in a new tab you have to use the target:โ€_blankโ€; tag within anchor tag as written below:- [code]Click Here [/code]There are more ways of using [code ]target:[/code] * [code ]_blank[/code]: Opens...
๐ŸŒ
Codedamn
codedamn.com โ€บ news โ€บ frontend
Using HTML to open link in new tab
June 6, 2023 - If a tab or window with that name already exists, the link will open in that tab or window. In conclusion, using the target attribute in HTML is a simple and effective way to open links in new tabs, providing a better user experience for your ...
๐ŸŒ
Reddit
reddit.com โ€บ r/html โ€บ coding a url to open in a new tab?
r/HTML on Reddit: Coding a URL to open in a new tab?
January 4, 2023 -

Hi all, I'm hoping this is the right place for this, but is there a way to something to a URL so that when that URL is linked or embedded somewhere, the link will automatically take them to a new tab?

I am trying to set a link in our top navigation menu on our WordPress site that uses Avada, and I don't have the option to just tell it to open that link in a new tab as a setting. So I was hoping I could set it to do so just by the link itself, but I'm not familiar enough with that to know if it is possible or not. Looking it up myself has only yielded results for "target=_blank" when doing hardcoding on the back end-something that isn't an option with the set up we have (or I'm just not aware of how to go about it).

Any help or advice is appreciated!

๐ŸŒ
Reddit
reddit.com โ€บ r/learnprogramming โ€บ how do i make a link open in a new tab? html, css, js
r/learnprogramming on Reddit: How do I make a link open in a new tab? HTML, CSS, JS
October 20, 2023 -

I have a button which has a link to a different website and when I click it, it redirects to the site but I want it to go to a different tab so that you can go back to it. I'm pretty sure it's possible since I see other websites do it all the time.

๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ javascript โ€บ how-to-open-url-in-new-tab-using-javascript
How to Open URL in New Tab using JavaScript? - GeeksforGeeks
<html> <head> <style> body { display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; font-family: Arial, sans-serif; } button { padding: 10px 20px; font-size: 16px; cursor: pointer; } </style> </head> <body> <p>Click the button to open <b>GeeksforGeeks</b> in a new tab:</p> <button onclick="NewTab()">Open GeeksforGeeks</button> <script> function NewTab() { window.open("https://www.geeksforgeeks.org////", "_blank"); } </script> </body> </html> ... When clicked, it runs the NewTab() function. window.open("https://www.geeksforgeeks.org////", "_blank"); opens the GeeksforGeeks website in a new tab. Here are the applications of opening URLs in new tabs: External Links: When linking to external websites, itโ€™s best to open them in a new tab to keep users on your site.
Published ย  August 21, 2025