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.
            Asked
            
        
        
            Active
            
        
            Viewed 647 times
        
    1
            
            
        - 
                    1Most browsers seem to block JavaScript access nowadays for security reasons. – Scoop Nov 25 '10 at 15:30
 - 
                    2Related: http://stackoverflow.com/questions/4244822/copy-paste-content-to-and-from-clipboard-using-javascript / http://stackoverflow.com/questions/2459276/how-to-copy-text-to-clipboard-in-firefox-3-5 http://stackoverflow.com/questions/453198/copy-to-clipboard-in-javascript – Marcel Korpel Nov 25 '10 at 15:35
 
1 Answers
2
            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.
        PleaseStand
        
- 31,641
 - 6
 - 68
 - 95