How to Open URL in New Tab using JavaScript

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 of method to open a URL in a new tab using JavaScript. The following JavaScript code will open in a new browser tab or window.'', '_blank');

Related Articles

Comments 0