Answers for "link to copy text to clipboard"

11

copy link to clipboard

function copy() {
  var copyText = document.querySelector("#input");
  copyText.select();
  document.execCommand("copy");
}

document.querySelector("#copy").addEventListener("click", copy);
Posted by: Guest on September-17-2019
2

copy link to clipboard

function copyToClipboard(text) {
  var input = document.body.appendChild(document.createElement("input"));
  input.value = text;
  input.focus();
  input.select();
  document.execCommand('copy');
  input.parentNode.removeChild(input);
}
Posted by: Guest on May-20-2020
4

javascript copy to clipboard

var copyTextarea = document.getElementById("someTextAreaToCopy");
copyTextarea.select(); //select the text area
document.execCommand("copy"); //copy to clipboard
Posted by: Guest on July-22-2019
1

jquery copy to clipboard

document.execCommand("copy");
Posted by: Guest on April-05-2020

Code answers related to "link to copy text to clipboard"

Code answers related to "Javascript"

Browse Popular Code Answers by Language