LANGUAGE » JAVASCRIPT » BROWSER

Window

On a onclick event handler:

js
const newTab = window.open('http://example.com', '_blank');
if (newTab) {
  newTab.focus();
}