Answers for "js select and copy on click"

1

js select and copy on click

document.getElementById("copy-text").onclick = function() {
  this.select();
  document.execCommand('copy');
  alert(window.getSelection().toString());
}
Posted by: Guest on May-13-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language