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
Thanks for the suggestion. I haven't used the Clipboard API yet but I am looking into it and I will write an updated version of this blog post using the Clipboard API.
I chose execCommand as I think this is the easiest way possible to achieve the goal
jad inerky
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