Update copyToClipboard.md

This commit is contained in:
Felix Wu
2018-04-10 16:28:11 +02:00
committed by GitHub
parent 8f3f97aebb
commit d5196eefe3

View File

@ -1,5 +1,7 @@
### copyToClipboard ### copyToClipboard
> **:warning: This is easily achievable by using the new Async Clipboard Api, which is still experimental by now but should be used in the future instead of this snippet. Find out more about it [here](https://github.com/w3c/clipboard-apis/blob/master/explainer.adoc#writing-to-the-clipboard).**
Copy a string to the clipboard. Only works as a result of user action (i.e. inside a `click` event listener). Copy a string to the clipboard. Only works as a result of user action (i.e. inside a `click` event listener).
Create a new `<textarea>` element, fill it with the supplied data and add it to the HTML document. Create a new `<textarea>` element, fill it with the supplied data and add it to the HTML document.