Categories
JavaScript Answers

How to open window.location in new tab with JavaScript?

Spread the love

To open window.location in new tab with JavaScript, we call the window.open method.

For instance, we write

window.open("https://example.com", "_blank");

to call window.open with the URL to open and '_blank' to open the URL in a new window or tab.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *