Reputation: 10246
I have text in JS variable and I want that to be copied in clipboard on a button's click. I need this in Javascript and code must not be browser-specific.
Upvotes: 1
Views: 704
Reputation: 32112
ZeroClipboard works fully within the browser's security restrictions. It uses Flash to copy to the clipboard, accessing a Flash movie from JavaScript. To work around Flash's own security limitation, it must be overlaid on top of some element of your page (e.g. a button) that the user will have to click. Read its instructions page for more details.
Upvotes: 2