Is there a way through HTML/JavaScript to copy a line of text for the user? So user selects a button and then text is copied, all he has to do now is go and paste it somewhere.
Asked
Active
Viewed 1,177 times
1
-
Please have a look at [this](http://stackoverflow.com/questions/7713182/copy-to-clipboard-for-all-browsers-using-javascript) post: – Ankit Zalani Jun 21 '13 at 18:22
2 Answers
-2
Can't do it with HTML or JavaScript. You'd have to use a flash or java component to copy the data to the clipboard. The reasons this is disabled is for security purposes.
An example of a flash powered method is this one.

Kat
- 4,645
- 4
- 29
- 81
-
2It *can* be done with JavaScript, it's just not the most reliable way to do so. – hexacyanide Jun 21 '13 at 18:25
-
It's disabled in most browsers. I'd consider that as not being able to do it. – Kat Jun 21 '13 at 18:26
-
its still not a correct answer, I found a way to do it in the Internet Explorer, however it does not carry over to other browsers. Apparently other browser use different code to achieve this. – Bagzli Jun 24 '13 at 13:31