Skip to main content
2 de 2
removeu 67 caracteres do conteúdo
function link(x) {
var url = x.href;
var guia = window.open(url, '_blank');
guia.focus();
console.log(url) 
}

e no html:

<a href="http://google.com" onclick="link(this)">url 1 </a><br>
<a href="http://yahoo.com" onclick="link(this)">url 2 </a><br>
<a href="http://bing.com" onclick="link(this)">url 3 </a><br>
<a href="http://duckduckgo.com" onclick="link(this)">url 4 </a>