1
I have a URL shortener, where there is listing with all the generated links. What I need is to create a button on the side, where when the person clicks on it, automatically copy the div containing the shortened link.
I’m trying something like this:
window.onload = function() {
document.getElementById("link").innerHTML = document.getElementById("btCopia").innerHTML;
}
The HTML is like this
<div id="link">teste1.1</div>
<div id="btCopia">COPIAR</div>
Syntax is not Ok, someone has done something similar, maybe with Jquery?
You can post the relevant HTML?
– Pedro Lorentz
I edited the question.
– Felipe Viero Goulart
Felipe: you want to copy
teste1.1
and change theCOPIAR
to beteste1.1
? have other fields where you want to do the same? with ids also?– Sergio