Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js select and copy on click

document.getElementById("copy-text").onclick = function() {
  this.select();
  document.execCommand('copy');
  alert(window.getSelection().toString());
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #select #copy #click
ADD COMMENT
Topic
Name
2+5 =