How to Open URL in New Tab using JavaScript

76
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 window.open() method opens a new browser window.

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

LEAVE A REPLY

Please enter your comment!
Please enter your name here