I want to set or get data or text to the clipboard, but without flash. Is it possible?
Asked
Active
Viewed 1,798 times
1 Answers
1
You can get the clipboard data in WebKit, but only during a paste event, for security reasons (random websites being able to copy from your system clipboard at any time would be bad). Assuming you have a a text input with id "textBox":
Live demo: http://jsfiddle.net/qc4s8/
Code:
document.getElementById("textBox").onpaste = function(evt) {
alert(evt.clipboardData.getData("text/plain"));
};
References: