DEV Community

Nabil Alamin
Nabil Alamin

Posted on

Copy to Clipboard in JS

const copyToClipboard = (txt) => navigator.clipboard.writeText(txt);
Enter fullscreen mode Exit fullscreen mode

Have a wonderful day 👋

Top comments (1)

Collapse
 
baraa_baba profile image
Baraa Baba

Thank you!