I have a URL shorter, where there is listing with all generated links. What I need is to create a button next to it, where when the person clicks on it, automatically copy the div that contains the shortened link.
I'm trying something like this:
window.onload = function() {
document.getElementById("link").innerHTML = document.getElementById("btCopia").innerHTML;
}
HTML is like this
<div id="link">teste1.1</div>
<div id="btCopia">COPIAR</div>
The syntax is not Ok, has anyone done anything like this, maybe with Jquery?