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 stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #copy #clipboard #javascript
ADD COMMENT
Topic
Name
3+5 =