You need to use the name attribute:

window.open("https://www.youraddress.com","_self")

Edit: Url should be prepended with protocol. Without it tries to open relative url. Tested in Chrome 59, Firefox 54 and IE 11.

Answer from vdbuilder on Stack Overflow
Discussions

Opening the same Tab if its already opened by clicking the same link | OutSystems
Opening the same Tab if its already opened by clicking the same link More on outsystems.com
๐ŸŒ outsystems.com
July 12, 2021
javascript - window.open() should open the link in same tab - Stack Overflow
I am very new to javascript, and written a program that will open a querystring as link. I used window.open() , but the link is opening in new tab, I want to open this link in the same tab. The cod... More on stackoverflow.com
๐ŸŒ stackoverflow.com
January 27, 2015
I want to open a new tab using javascript. But I should not lose my focus on the current tab
I want to open a new tab using javascript. But I should not lose my focus on the current tab. More on forum.freecodecamp.org
๐ŸŒ forum.freecodecamp.org
1
0
January 17, 2019
firefox - JavaScript open in a new window, not tab - Stack Overflow
Yes it works, but this seems to be a bit of a hack. Firefox is written in such a way that opening a new window vs tab is a browser preference, not a javascript preference. Therefore it is feasible that your suggestion wont work the same in a later version of firefox. More on stackoverflow.com
๐ŸŒ stackoverflow.com
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ html โ€บ how-to-open-url-in-same-window-and-same-tab-using-javascript
How to open URL in same window and same tab using JavaScript ? - GeeksforGeeks
July 24, 2025 - The "_self" parameter specifies that the URL should be loaded in the current window. Example: In this example, we have used the window.open() method to open the "geeksforgeeks.org" URL in the same window and in the same tab.
๐ŸŒ
CodexWorld
codexworld.com โ€บ home โ€บ how to guides โ€บ how to open url in same window and tab using javascript
How to Open URL in Same Window and Tab using JavaScript - CodexWorld
April 15, 2023 - The JavaScript window.open() method allows you to open URL in the browser tab or window. You can use _self value in the second parameter of the window.open() method to open the URL in the same tab and in the same window with JavaScript.
๐ŸŒ
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.
๐ŸŒ
RNT Lab
rntlab.com โ€บ question โ€บ html-open-url-in-same-window-and-in-same-tab
HTML โ€“ Open URL in same window and in same tab
"{window.open('/serverIndex', '_ self')}" "{location.href ='/serverIndex'}" "{window.location.replace('/serverIndex'}" "{window.location.href = '/serverIndex'}" The first one opens the new page in a new tab, with the other three nothing happens. Paul ... I only had time to properly test and give you the solution to this problem. Hereโ€™s how to load the /serverIndex page in the same tab. You need to make two changes to the const char* loginIndex. First change, in the very first line, add this attribute (action=โ€™javascript:void(0);โ€™).
Find elsewhere
๐ŸŒ
Delft Stack
delftstack.com โ€บ home โ€บ howto โ€บ javascript โ€บ javascript open url in same tab
How to Open URL in the Same Window or Tab in JavaScript | Delft Stack
February 2, 2024 - The window.open() method is a JavaScript pre-defined window technique for opening a new tab or window in the same window and tab in the browser.
๐ŸŒ
w3tutorials
w3tutorials.net โ€บ blog โ€บ open-url-in-same-window-and-in-same-tab
How to Open a URL in the Same Window and Tab Using JavaScript (Fixing window.open New Tab Issue) โ€” w3tutorials.net
If using window.open(), set target="_self" and omit the features parameter to force same-tab behavior. By following these methods, youโ€™ll avoid the "new tab" issue and ensure a smooth user experience.
๐ŸŒ
Sololearn
sololearn.com โ€บ en โ€บ Discuss โ€บ 346470 โ€บ how-to-open-url-in-same-window-and-in-same-tab-
How To Open URL in same window and in same tab ??? | Sololearn: Learn to code for FREE!
I want to open a link in the same window and in the same tab that contains the page with the link. When I try to open a link by using window.open, then it opens in new tabโ€”not in the same tab in the same window. ... If you want to do this in HTML: <a href = "page.html" target = "_self"> </a> Else, use Javascript: window.open('page.html', '_self'); Bye.
๐ŸŒ
Mycode
mycode.blog โ€บ lakshmi โ€บ open-linkurl-same-tabwindow-or-new-tab-html-js
Open Link/URL in Same Tab/Window or New Tab in HTML & JS | mycode.blog
October 30, 2023 - In JavaScript, if you want to open a link in the same tab or window, you can do so by setting window.location to the new URL, effectively replacing the current page. On the other hand, to open a link in a new tab, you can utilize the window.open() ...
๐ŸŒ
UsefulAngle
usefulangle.com โ€บ post โ€บ 337 โ€บ html-open-links-in-same-tab
Open Links in a New Tab, Or Re-Use Already Existing Tab
November 27, 2020 - <!-- same target attribute --> ... 3</a> If opening the links with Javascript open() method, the same window name needs to be provided for the given set of links....
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ javascript โ€บ how-to-open-url-in-new-tab-using-javascript
How to Open URL in New Tab using JavaScript? - GeeksforGeeks
It returns null if it fails to open the new tab. Avoid adding a third parameter to the window.open() method because it could result in a new window instead of a tab.
Published ย  August 21, 2025
๐ŸŒ
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.