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 OverflowDhiWise
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.
Videos
13:28
Tab, Window, and iFrame control with window.open - YouTube
01:32
How To Open URL In The Same Tab Or In The Same Window - YouTube
00:23
javascript - Open URL in same window and in same tab - YouTube
05:30
How to open Link in the same tab in Cypress - YouTube
03:05
Autohotkey : Open URL In The Same Tab - YouTube
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
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.
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 .....
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
Skip to main content · Google Chrome Help · Sign in · Google Help · Help Center · Community · Google Chrome · Terms of Service · Submit feedback · Send feedback on
OutSystems
outsystems.com › forums › discussion › 71870 › opening-the-same-tab-if-its-already-opened-by-clicking-the-same-link
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
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.
UsefulAngle
usefulangle.com › post › 337 › html-open-links-in-same-tab
Open Links in a New Tab, Or Re-Use Already Existing Tab
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.
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.
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
Mozilla Support
support.mozilla.org › en-US › questions › 1226151
How can I force links to open in the same tab instead of a new one? | Firefox Support Forum | Mozilla Support
See also: *http://kb.mozillazine.org/browser.link.open_newwindow *1: current tab; 2:new window; 3:new tab; For links opened via JavaScript you can look at this pref: *http://kb.mozillazine.org/browser.link.open_newwindow.restriction