JavaScript open URL in new tab | Example code

  • by

Use method to open URL in a new tab, but it could be open in the new browser window or a new tab depending on the browser setting and the parameter values., '_blank');

Example code open URL in a new tab in JavaScript

HTML example code:

Using _blank in the second parameter of to open a new tab in the example:-



		function NewTab() {"", "_blank");
		// calling function 




JavaScript open URL in new tab

Do comment if you have any doubts and suggestions on these JS URL examples.

Note: The All JS Examples codes are tested on the Firefox browser and the Chrome browser.

OS: Windows 10

Code: HTML 5 Version

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.