Formatting changes

This commit is contained in:
Angelos Chalaris
2018-09-27 22:47:46 +03:00
parent b44b539b40
commit e97fdf2682
14 changed files with 22 additions and 15 deletions

View File

@ -2,7 +2,8 @@
⚠️ **NOTICE:** The same functionality can be easily implemented by using the new asynchronous Clipboard API, which is still experimental 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.
Use `Selection.getRangeAt()`to store the selected range (if any).