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
🌐
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.
Discussions

window.open() should open the link in same tab
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
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 to Open a New Webpage in Same Tab - Programming & Development - Spiceworks Community
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(... More on community.spiceworks.com
🌐 community.spiceworks.com
0
November 5, 2014
HTML - Open URL in same window and in same tab
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 t… More on forum.arduino.cc
🌐 forum.arduino.cc
0
0
February 22, 2019
People also ask

How do I open a link in a new tab in HTML?
When wondering how to open a link in a new tab in HTML, the recommended solution is to use the combination of target="_blank" and rel="noopener noreferrer" for reliable performance across browsers.
🌐
dhiwise.com
dhiwise.com › post › html-open-link-in-new-tab-improve-user-navigation
How to Open Links in a New Tab Safely in HTML
How do I make my HTML link open in a new tab?
Use the target="_blank" attribute in the anchor tag along with rel="noopener noreferrer" for security.
🌐
dhiwise.com
dhiwise.com › post › html-open-link-in-new-tab-improve-user-navigation
How to Open Links in a New Tab Safely in HTML
What is target="_blank" in HTML?
It instructs the browser to open the link in a new tab or new window.
🌐
dhiwise.com
dhiwise.com › post › html-open-link-in-new-tab-improve-user-navigation
How to Open Links in a New Tab Safely in HTML
🌐
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 "url" is the URL that you want to load in the same window and in the same tab. 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.
🌐
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.
🌐
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 = window.open("", "", "width=200,height=100"); Try it Yourself » ·
🌐
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.
Find elsewhere
🌐
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.
🌐
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!
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 .....
🌐
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 you must use window.open() (e.g., legacy code or specific use cases), you can force it to open in the same tab by explicitly setting the target parameter to _self.
🌐
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 ...
🌐
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
🌐
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
Most links should not open in a new tab or window by default using the target="_blank" attribute. By keeping the default link behavior, users can then decide for themselves whether to open the page in a new tab or window. Links that open in the same tab or window are also more secure for your users.
🌐
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(...
🌐
YouTube
youtube.com › shorts › LvOuEMlHagc
javascript - Open URL in same window and in same tab - YouTube
#short#javascript#html#hyperlink#hrefI 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 l...
Published   March 12, 2023
🌐
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.
🌐
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.