1

I want to set or get data or text to the clipboard, but without flash. Is it possible?

blez
  • 4,939
  • 5
  • 50
  • 82

1 Answers1

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:

Community
  • 1
  • 1
Tim Down
  • 318,141
  • 75
  • 454
  • 536