Tagged: copy to the clipboard in JavaScript

How to copy to the clipboard in JavaScript?

Automatic copying to clipboard may be dangerous, therefore most browsers (except IE) make it very difficult. Personally, I use the following simple trick: function copyToClipboard (text) { window.prompt (“Copy to clipboard: Ctrl+C, Enter”, text);...