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
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › API › Window › open
Window: open() method - Web APIs | MDN
The open() method of the Window interface loads a specified resource into a new or existing browsing context (that is, a tab, a window, or an iframe) under a specified name.
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
Open a URL in a new tab (and not a new window)
The question is specifically about opening in a new tab even if the preferences are for a new window. 2020-02-02T20:48:01.467Z+00:00 ... To open a new tab and stay on the same location, you can open the current page in the new tab, and redirect the old tab to the new URL. More on stackoverflow.com
🌐 stackoverflow.com
How to make links open in same 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
October 19, 2019
How can I make links open in the same window? - Sites Community
Skip to main content · Sites Help · Sign in · Google Help · Help Center · Community · Sites · Terms of Service · Submit feedback · Send feedback on More on support.google.com
🌐 support.google.com
🌐
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 = ...
🌐
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.
🌐
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'}" No one worked for me. ... Which web browser are you using? One of those examples should work, because it’s the official API to open 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.
Find elsewhere
🌐
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 HTML, utilizing the target="_blank" attribute ensures that the link opens in a new tab. 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 ...
🌐
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!
April 27, 2017 - If you want to do this in HTML: <a href = "page.html" target = "_self"> </a> Else, use Javascript: window.open('page.html', '_self'); Bye. :) ... target=_blank is used to open link in new tab, what if we remove target attribute, won't that help in html, and In JavaScript by default would be different like opening in new tab .....
🌐
Kevincox
kevincox.ca › 2023 › 04 › 24 › browser-link-open-newwindow
Should Links Open in the Same Tab or a New One? - Kevin Cox
April 24, 2023 - Open “new window” links in a new tab of the current window. Personally I set it to 1 to make all links open in the same window. Overall this works well and makes the web more predictable. However, it can cause some site breakage.
🌐
Western Washington University
marcom.wwu.edu › accessibility › guide › links-should-open-same-tabwindow
Links should open in the same tab/window | University Communications and Marketing | Western Washington University
Links that are set to open in new tabs/windows have no override for this behavior, so users are forced into a new tab/window whether they prefer that behavior or not.
🌐
Google Support
support.google.com › chrome › thread › 17211390 › how-to-make-links-open-in-same-tab
How to make links open in same tab? - Google Chrome Community
October 19, 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
🌐
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 - This behavior is beneficial in the case where we want to limit the number of new tabs created by the page. This can be achieved in HTML by setting the same name for the target attribute for all the given links. The name can be anything as per wish. <!-- same target attribute --> <a href="https://google.com" target="child">Link 1</a> <a href="https://bing.com" target="child">Link 2</a> <a href="https://msn.com" target="child">Link 3</a> If opening the links with Javascript open() method, the same window name needs to be provided for the given set of links.
🌐
Google Support
support.google.com › sites › thread › 175683457 › how-can-i-make-links-open-in-the-same-window
How can I make links open in the same window? - Sites Community
Skip to main content · Sites Help · Sign in · Google Help · Help Center · Community · Sites · Terms of Service · Submit feedback · Send feedback on
🌐
Spiceworks
community.spiceworks.com › programming & development
How to Open a New Webpage in Same Tab - Programming & Development - Spiceworks Community
November 5, 2014 - From my default.aspx page, I need to click on a button and open a different webpage, in the same tab. How is this done? There are 5 buttons and they are in a table. Each button when clicked should open a different aspx webpage. The OnClientClick for each button has the following: window.open(...
🌐
Arduino Forum
forum.arduino.cc › projects › programming
HTML - Open URL in same window and in same tab - Programming - Arduino Forum
February 22, 2019 - Hello, I hope someone can help me. I have taken the code "ESP32 Web Updater Over The Air" from Last Minute Engineers https://lastminuteengineers.com/esp32-ota-web-updater-arduino-ide/ and it works very well. But I try that once the username and password are entered in /loginIndex, the next page (/serverIndex) opens in the same tab and in the same browser window.
🌐
freeCodeCamp
forum.freecodecamp.org › t › can-not-open-url-in-same-window › 351185
Can not open URL in same window - The freeCodeCamp Forum
February 18, 2020 - Hi everyone! I’m using window.location = “” to link to another html page when a user have entered correctly username and password but it doesn’t work. I also tried window.open() – this work well, but I don’t want it to open a new tab, window.location.assign(), window.location.href = “” and window.open("" , “_self”) but nothing work.