link copies to input field on click code example
Example: js select and copy on click
document.getElementById("copy-text").onclick = function() {
this.select();
document.execCommand('copy');
alert(window.getSelection().toString());
}
document.getElementById("copy-text").onclick = function() {
this.select();
document.execCommand('copy');
alert(window.getSelection().toString());
}