Category: document.execCommand

Roll Your Own Copy to Clipboard Feature in 20 Lines of JavaScript

Using the OS clipboard is a basic IT skill. As a developer, you’ve learned that tab, Ctrl/Cmd+A, Ctrl/Cmd+C followed by Ctrl/Cmd+V will highlight, copy and paste in an instant. Life is less easy for regular users. Even if a user knows what the clipboard is, those with 20:20 vision and cat-like reflexes can strugg...