Copy text to clipboard

PHOTO EMBED

Wed Jan 05 2022 11:19:38 GMT+0000 (Coordinated Universal Time)

Saved by @desiboli ##javascript ##js

const copyToClipboard = (text) => navigator.clipboard.writeText(text);
copyToClipboard("Hello World");
content_copyCOPY

https://blog.devgenius.io/15-javascript-codes-you-will-always-need-e8569903dd1