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
๐ŸŒ
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:
๐ŸŒ
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.
๐ŸŒ
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
๐ŸŒ
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
๐ŸŒ
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.
Find elsewhere
๐ŸŒ
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.
๐ŸŒ
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.
๐ŸŒ
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)
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.
๐ŸŒ
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 ...
๐ŸŒ
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.
๐ŸŒ
WeWeb Community
community.weweb.io โ€บ ask us anything โ€บ how do i?
Right Click + Open in new tab - How do I? - WeWeb Community
June 9, 2023 - How do I make it so I can right click on a button or element and select open in new tab? I have a link added to the element, but the option doesnโ€™t show up when I right click in the browser.