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 developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #copy #clipboard #javascript
ADD COMMENT
Topic
Name
6+8 =