doubts about target="_Blank"

Asked

Viewed 368 times

0

When I use target="_Blank" he opens a new flap and focuses on it i just want it to open a new tab but that the focus continues on the current page.

  • Advertising Detected... ? Xp

1 answer

2

There is but you need to do it using javascript, only the link won’t make it. Change your link to include a call to a function like this:

<a href="endereço-da-janela" target="_blank" onclick="return abrirJanela(this))">

Then in the Function you open the window and turn the focus to the current window:

function abrirJanela(link) {
    var novaJanela = window.open("about:blank", link.target, "width=500,height=500");
    novaJanela.blur();
    window.focus();
    novaJanela.location.href = link.href;
    return false;
}

Browser other questions tagged

You are not signed in. Login or sign up in order to post.