How to Open Another HTML Page in JavaScript?

Estimated read time 1 min read

You can open another HTML page in JavaScript using the method.

Here’s an example:

function openPage() {"", "_blank");

In this example, calling the openPage function will open the URL “” in a new browser window or tab (depending on the browser’s settings). The second argument, "_blank", specifies that the page should be opened in a new window. If you change it to "_self", the page will be opened in the same window.

You May Also Like

More From Author

+ There are no comments

Add yours

Leave a Reply