1
Guys, I need help with something simple, but I couldn’t find it on the internet, maybe because I don’t know the correct term to search. But I wanted the following: When you click on the code button below, the first click will open a link, and the second click will open the second link. In short, two links on the same button. Currently my button is like this, but I wanted to make him open another link before opening the www.google.com link. Could someone help me with this?
<div class="baixar">
<a id="botao2" href="www.google.com" target="_blank"><h3>DOWNLOAD</h3> </a>
</div>
Man, I’m trying like this;
<a id="botao2" href="http://primeirolink.com" target="_blank" onclick="var t=this; setTimeout(function(){t.href="<?php echo base64_decode($queryString["src"])?>"},10)> <h3>DOWNLOAD</h3> </a>
But you don’t change the link, you keep going to the first link.– RafaelMacedo
Look at the source code of the page to see how the HTML of the link is getting.
– Sam
Failed to close the onclick with
"
after the,10)
.– Sam
I put: http://prntscr.com/oll273. But it still doesn’t work :/
– RafaelMacedo
It is after the
,10)
, thus:<a id="botao2" href="http://primeirolink.com" target="_blank" onclick="var t=this; setTimeout(function(){t.href='<?php echo base64_decode($queryString["src"])?>'},10)"> <h3>DOWNLOAD</h3> </a>
– Sam
And the link should be in single quotes. You put the PHP code inside double quotes, unlike what I put in the answer.
– Sam
Ah, now it’s worked out. Thank you so much, man. You’re wild!
– RafaelMacedo