This question already has an answer here:
- How do I copy to the clipboard in JavaScript? 50 answers
The workflow is simple:
- You click inside a textarea.
- The text is copied to the client\'s clipboard.
- Display notice to the user.
How do you do it?
This question already has an answer here:
The workflow is simple:
How do you do it?
Started the search here and found https://github.com/terinjokes/zClip - works perfectly for me.
Copying to the clipboard is a tricky task to do in Javascript in terms of browser compatibility. The best way to do it is using a small flash. It will work on every browser. You can check it in this article.
Here\'s how to do it for Internet Explorer:
function copy (str)
{
//for IE ONLY!
window.clipboardData.setData(\'Text\',str);
}
There are a bunch of options over here: http://www.jquery4u.com/plugins/jquery-copy-clipboard-4-options/#.UFbo1YriYz0
I was in need of something like this, and this one seems promising:
http://github.com/mojombo/clippy
Here\'s a simple jquery plugin for it as well: http://gist.github.com/66579
This one is cross browser and works with Flash 10.
http://beckelman.net/post/2009/01/22/Copy-to-Clipboard-with-ZeroClipboard-Flash-10-and-jQuery.aspx