This is a trick,

function openInNewTab(url) {
  window.open(url, '_blank').focus();
}

// Or just
window.open(url, '_blank').focus();

In most cases, this should happen directly in the onclick handler for the link to prevent pop-up blockers, and the default "new window" behavior. You could do it this way, or by adding an event listener to your DOM object.

<div onclick="openInNewTab('www.test.com');">Something To Click On</div>

Reference: Open a URL in a new tab using JavaScript

Answer from Duke on Stack Overflow
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › API › Window › open
Window: open() method - Web APIs | MDN
By default, window.open opens the page in a new tab. If popup is set to true, it requests that a minimal popup window be used. The UI features included in the popup window will be automatically decided by the browser, generally including an address bar only.
Discussions

Is there a shortcut for "click to open link in new tab" on a laptop?
Ctrl+click works if the site doesn't hijack the link with a script. If necessary, right-click then T (or click Open Link in New Tab). More on reddit.com
🌐 r/firefox
4
5
May 1, 2023
Open new tab instead of new window
We don't like when you click a link and it opens a new window. We only want it to open in a new tab. I can't find that setting anywhere to change. I know it works on my laptop, but as soon as I use another profile or edge on another PC, we keep getting… More on learn.microsoft.com
🌐 learn.microsoft.com
4
198
April 18, 2022
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
i want to open a new chrome window each time i click chrome on taskbar, not just add a tab. - Google Chrome Community
Skip to main content · Google Chrome Help · Sign in · Google Help · Help Center · Community · Google Chrome · Terms of Service · Submit feedback · Send feedback on More on support.google.com
🌐 support.google.com
March 27, 2019
🌐
Google Support
support.google.com › chrome › answer › 2391819
Manage tabs in Chrome - Computer - Google Chrome Help
When you open a new tab, Chrome opens a personalized New Tab page. Some of the ways you can customize your New Tab page content are with: ... Your shortcuts Learn how to customize your New Tab page. ... At the top of your Google Chrome window, next to the last tab on the right, click New tab .
🌐
Chrome Web Store
chromewebstore.google.com › detail › new-tab-new-window › dndlcbaomdoggooaficldplkcmkfpgff
New Tab, New Window - Chrome Web Store
Activate new tab and move it to beside of opener tab. ... Average rating 4.8 out of 5 stars. Learn more about results and reviews. This extension creates a new window with the tabs to the right of the currently selected tab.
🌐
Reddit
reddit.com › r/firefox › is there a shortcut for "click to open link in new tab" on a laptop?
r/firefox on Reddit: Is there a shortcut for "click to open link in new tab" on a laptop?
May 1, 2023 -

Supposedly it's middle mouse button, but obviously I'm lacking that. In other browsers it was generally ctrl+click (on a link) to open a link in a new tab. But that isn't working.

Can't find any options in the settings either to change it. Is there a workaround, or an addon/extension for this?

Edit: To clarify, I'm not talking about Ctrl+T. That just opens a blank tab, or my last closed tab.

🌐
W3Schools
w3schools.com › jsref › met_win_open.asp
Window open() Method
The open() method opens a new browser window, or a new tab, depending on your browser settings and the parameter values. The close() method. window.open(URL, name, specs, replace) Open an about:blank page in a new window/tab: var myWindow = ...
Top answer
1 of 4
13

Thanks for reply. None of those options worked. The problem is 50/50, some hyperlinks it works find, others hyperlinks it doesn't.

  • Right clicking option is disabled (greyed out).
  • Holding CTRL doesn't work either. It still opens it in a new browser window
  • The problem seems to depend on the hyperlink.
  • I ran the powershell option on a test PC and nothing changed.
  • I know there is a way to fix this because my PC (profile) works just fine. I have a few other staff that work fine. But anytime I hire a new person or they log into the PC profile of their own, it reverts back to opening up links in a new window.

Chrome has a simple option that says (open links in a new tab), is there no simple setting option in edge? My company I'm contracted with requires us to use edge.

2 of 4
5

Hi JDSuser, welcome to the Microsoft community, my name is Bruno Leonel.

We will be happy to help and see if we can resolve this issue for you. Follow some of the recommended suggestions below that have helped others.

I understand that you are having problems opening links in a new tab and I will try to help you in the best way.

There are some possibilities to open a link in the same tab see below:

In Microsoft Edge, you can open a link in a new tab, just right-click on the link and then choose “Open in a new tab”

You can also use the Ctrl key (press it and keep it pressed) and click with the left mouse button and the link will open in a new tab.

NOTE: If the links that are opening in a new window are from the google search site

At the bottom of the page click settings -> search settings

And confirm that the following option is checked: "Open each selected result in a new browser window"

Give it a try, if it doesn't work, check the steps below:

To try to resolve it, follow the steps below:

step 1

With Microsoft Edge open press Alt+F;

Click "Settings" / "Reset Settings" / "Restore Settings to Default Values";

And confirm by clicking Reset;

Close the browser and open it again.

After this process, check if you are in agreement.

Step 2

Note: If when opening Microsoft Edge, a Welcome tab opens, it means that the browser has been reset. Make a backup of your bookmarks before performing this action.

Close Microsoft Edge.

Open the start menu and type PowerShell.

Right-click Run As Administrator.

Copy and paste the command below:

Get-AppXPackage -AllUsers | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "C:\Windows\SystemApps\*Edge*\AppXManifest.xml"}
$manifest = (Get-AppxPackage *Edge*).InstallLocation + '\AppxManifest.xml' ; Add-AppxPackage -DisableDevelopmentMode -Register $manifest

After the command execution is complete, try to open Microsoft Edge.

If the answer helped in any way, please mark it as an answer, if your question has not been solved, please post again.

I hope I helped, see you later!

Find elsewhere
🌐
Wikihow
wikihow.com › computers and electronics › internet › internet browsers › how to open a new window: 4 easy ways
How to Open a New Window in a Web Browser
June 4, 2025 - Choose Open in New Window. The page will open in a new window. Alternatively, you can pick Open in New Tab if you want it to open in a new tab within your window.
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › how-to-open-url-in-new-tab-using-javascript
How to Open URL in New Tab using JavaScript? - GeeksforGeeks
Second Parameter ("_blank"): Tells the browser to open the URL in a new tab. Return Value: The method returns a reference to the new tab/window or null if it fails.
Published   August 21, 2025
🌐
Zipy
zipy.ai › blog › how-to-open-a-url-in-a-new-tab-and-not-a-new-window
how to open a url in a new tab (and not a new window)
April 12, 2024 - JavaScript stands at the core of dynamic web development, offering a plethora of methods to manipulate the DOM and control the browser's behavior. One such capability is opening URLs in new tabs using the window.open() method.
🌐
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
HTML’s target="_blank" is the simplest method to open links in a new tab, requiring no additional scripting. JavaScript provides dynamic control using window.open(), making it ideal for programmatically opening links in new tabs.
🌐
Quora
quora.com › How-do-you-switch-to-a-new-window-new-tab-which-opens-up-after-you-click-on-a-link
How to switch to a new window (new tab) which opens up after you click on a link - Quora
Answer: I dont know in which context you are asking so i will write both of cases i know you might be asking about. 1.Html source anchor tag You can use “target” attribute of anchor tag to force open that url in new tab. [code] Open Quora ...
🌐
DEV Community
dev.to › digvijaysingh › how-to-open-a-new-tab-or-window-using-javascript-5ebc
How to Open a New Tab or Window using Javascript? - DEV Community
October 23, 2020 - It is a very general use case to open a link in another tab or in a separate window. We prefer to use target="_blank" attribute in HTML to open a link in new tab.
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › how-to-open-url-in-a-new-window-using-javascript
How to open URL in a new window using JavaScript? - GeeksforGeeks
August 21, 2025 - The anchor tag (<a>) can also be utilized with JavaScript to open URLs in new windows or tabs. By specifying target="_blank", the link will open in a new tab.
🌐
GitHub
github.com › gethomepage › homepage › discussions › 1980
Open in new window instead of new tab? · gethomepage/homepage · Discussion #1980
_blank is the default which opens a new tab. Refer to: https://www.ionos.com/digitalguide/websites/web-development/html-target/#:~:text=_self is the default and,the same tab or page.&text=_blank causes the hyperlink to,tab or a different ...
Author   gethomepage
🌐
Computer Hope
computerhope.com › issues › ch001112.htm
How to Open a New Tab in an Internet Browser
September 7, 2025 - Users may move forward through tabs by pressing Ctrl+Tab, and backward by pressing Ctrl+Shift+Tab. How to create a link that opens a new web page window or tab.
🌐
Google Support
support.google.com › chrome › thread › 3125709 › i-want-to-open-a-new-chrome-window-each-time-i-click-chrome-on-taskbar-not-just-add-a-tab
i want to open a new chrome window each time i click chrome on taskbar, not just add a tab. - Google Chrome Community
March 27, 2019 - Skip to main content · Google Chrome Help · Sign in · Google Help · Help Center · Community · Google Chrome · Terms of Service · Submit feedback · Send feedback on
🌐
Google Support
support.google.com › chrome › thread › 248388945 › every-time-i-open-a-new-tab-ctrl-t-it-opens-in-the-new-window-instead-of-the-original-window
Every time I open a new tab (ctrl+T), it opens in the new window instead of the original window. - Google Chrome Community
December 13, 2023 - Skip to main content · Google Chrome Help · Sign in · Google Help · Help Center · Community · Google Chrome · Terms of Service · Submit feedback · Send feedback on