Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

copy to clipboard

const copyToClipboard = (text) =>
  navigator.clipboard?.writeText && navigator.clipboard.writeText(text);
// Testing
copyToClipboard("Hello World!");
Source by tapajyoti-bose.medium.com #
 
PREVIOUS NEXT
Tagged: #copy #clipboard
ADD COMMENT
Topic
Name
8+7 =