Question:

I want to open an URL in the same window without opening a new tab.

How to do this?

Answer:

We need to add the following attribute.

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

If the attribute doesn’t have "_self", it will oepn this URL in a new window/tab.

Reference


This is the end of post