๐ก Easy Copy to Clipboard Button in Vanilla JavaScript
๐ Welcome back developers.
So, in this article we will see how we can create a simple Copy to Clipboard functionality in JavaScript.
Note: This will only work if you want to copy text inside of an input or textarea. It can't be done with any other ...
blog.usmans.me4 min read
good post but I must suggest you mention that the
document.execCommand('copy');is not a good solution, knowing that it might be removed at any time from any browser, See Docs and you can advise people to use a more stable and safe method as the Clipboard API still the best solution for me is to use them both, I can use the Clipboard API and the .execCommand() as a fallback