Answers for "how to add copy to clipboard button on page javascript"

11

js copy text 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

Code answers related to "how to add copy to clipboard button on page javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language