Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

copy to clipboard javascript

$('.copyable').click(function (event) {
  const targetInput  = document.getElementById('copyable');
  targetInput.select();
  document.execCommand('copy');
  //navigator.clipboard.writeText(targetInput.getAttribute('data-url'));
  alert("Link Copied");
});
Source by dev.to #
 
PREVIOUS NEXT
Tagged: #copy #clipboard #javascript
ADD COMMENT
Topic
Name
2+4 =