Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript how-do-i-copy-to-the-clipboard-in-javascript

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);
}
Source by dev.to #
 
PREVIOUS NEXT
Tagged: #javascript
ADD COMMENT
Topic
Name
4+9 =