How to Open URL in New Tab using JavaScript

Open URL in New Tab using JavaScript

In this blog post, you will find one of the most useful javascript tips and tricks ie: how to open URL new tab in JavaScript. Find the following syntax and example below:-

HTML <a> target attribute provides an easy and simple way to open the linked URL in the new browser window or tab. But sometimes it requires opening a URL with JavaScript. The JavaScript method opens a new browser window.

Use _blank in the second parameter open a URL in a new tab using JavaScript. The following JavaScript code will open Https:// in a new browser tab or window.


Please enter your comment!
Please enter your name here