You can use the following.

window.open(
  'https://google.com',
  '_blank' // <- This is what makes it open in a new window.
);

in HTML

 <button class="btn btn-success" onclick=" window.open('http://google.com','_blank')"> Google</button>

plunkr

Answer from ngLover on Stack Overflow
🌐
Bobby Hadz
bobbyhadz.com › blog › javascript-open-link-in-new-tab-on-button-click
Open a Link in a new tab on Button click in JavaScript | bobbyhadz
Add an event listener to the button. Use the window.open() method to open the link in a new tab. For example, window.open('https://example.com', '_blank'). Here are the contents of our index.html file.
Discussions

open a new tab when clicking a link button - javascript
I am using below code to generate buttons with link. but problem is it is opening in same tab. i want it to open in new tab. Can somebody suggest me a method which will work for most of the browse... More on stackoverflow.com
🌐 stackoverflow.com
Javascript - Open a given URL in a new tab by clicking a button - Stack Overflow
I would like to have a button that redirects to a given URL and opens in a new tab. How can this be done? 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
Button to open link in new tab - javascript
I am making a website and I want a new tab to open at a specific address when I click a button. This is the html for my button: Download More on stackoverflow.com
🌐 stackoverflow.com
🌐
Codedamn
codedamn.com › news › frontend
Using HTML to open link in new tab
June 6, 2023 - In this example, the target="_blank" attribute-value pair tells the browser to open the linked document in a new tab or window. The target attribute can take several values, each resulting in a different behavior when the link is clicked:
🌐
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
🌐
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
We use the target attribute in the opening <a> tag to open a link in HTML in a new tab. The value of this attribute should be set to _blank. When the link text is clicked, the website link opens in a new tab.
🌐
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
Find elsewhere
🌐
Tutorial Reference
tutorialreference.com › javascript › examples › faq › javascript-how-to-open-link-in-new-tab-on-button-click
How to Open a Link in a New Tab on Button Click in JavaScript | Tutorial Reference
Opening a link in a new tab is a standard web feature. While this is the default behavior of an HTML anchor (<a>) tag, you sometimes need to trigger this action from a <button> element, for example, after a form is processed or as part of a more complex JavaScript interaction. The standard browser method for this is window.open(). This guide will teach you the correct and safe way to use window.open() to open a new tab from a button click, explain the important semantic difference between a <button> and an <a> tag, and cover the critical noopener security feature.
🌐
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.
🌐
Afterpattern
university.afterpattern.com › faqs › button-new-tab
How to make a button that opens in a new tab?
November 27, 2020 - Feel free to read the FAQs to find what you are looking for.
🌐
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 - As you can see in this Can I use table, the noopener keyword is supported by most browsers except for Internet Explorer 11. Even with this update, a lot of developers will still use rel=noopener for links using the target=_blank attribute.
🌐
Tadabase
docs.tadabase.io › snippets › article › set-link-button-to-open-in-a-new-tab
Set Link Button to Open in a New Tab
TB.render('component_XX',funct... by hovering over the info icon at the top of the component in the builder. The attribute target="_blank" can only be applied to <a href links, not button links, so the only way to use a single script to target all of the buttons on a page ...
🌐
The Sitewizard
thesitewizard.com › html-tutorial › open-links-in-new-window-or-tab.shtml
How to Make Links Open in a New Window or Tab (thesitewizard.com)
December 23, 2019 - The power users learn, in addition, how to right click a link and select "Open in a new tab" (or window) when they need a link to be displayed in a separate tab or window. When you create links that open in a new window, you are actually preventing newcomers from returning to your website.
🌐
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 - The simplest method to open a link in a new tab is by using the target attribute with the value _blank to the anchor tag. When a user clicks this link, the browser opens the linked URL in a new tab or new window, depending on the browser's settings.