Web pages contain external links that open URLs in a new tab. For example, Wikipedia articles show links to open the reference sites in a new tab. This is absolutely for beginners.
There are three ways to open a URL in a new tab.
<a href="https://www.phppot.com" target="_blank">Go to Phppot</a>
The above line makes opening a URL and focuses the newly opened tab.
var url = "https://www.phppot.com"; var link = document.createElement("a"); link.href = url; link.target = "_blank"; link.click();