The Definitive Guide to Copying and Pasting in JavaScript
Ever wondered how rich text editors and drawing tools on the Web implement copy and paste functionality?
Turns out that clipboard access in JavaScript is pretty limited, yet it's possible to do things like:
- Paste an image from system clipboard into an app
- Copy/paste formatted text (html) from/to an app
- Copy and paste custom objects within an app
The trick basically comes down to using a hidden text input element and hijacking the clipboard events that are happening on it.
See the article below for implementation details:
Written by Dmitry Pashkevich
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#