title: javascript cut/copy/paste to clipboard: how did Google solve it?
body: <p>Yes, this question has been asked again and again: how to copy and paste from and to the system clipboard with javascript? I have found only partial solutions and hacks so far.
  The reason that it has been asked so often in the past is that there still is no working solution. However, I saw that Google Docs actually has a working solution now for both keyboard events as well as buttons. So, it is possible, but how do they do it? Software Salad article, <a href="http://brooknovak.wordpress.com/2009/07/28/accessing-the-system-clipboard-with-javascript/" rel="noreferrer"><em>Accessing the System Clipboard with JavaScript – A Holy Grail?</em></a>, gives a nice overview of the problem (but it's a few years old).</p>
  
  <p>In short:</p>
  
  <ul>
  <li><p>you can use keyboard events ctrl+x, ctrl+c, ctrl+v to either copy text from a hidden textarea with prepared data, or catch pasted text in a hidden field and then do something with it</p></li>
  <li><p>you can use some hack via Flash or maybe a Java Applet to copy something to the system clipboard without need for user approval.</p></li>
  <li><p>you can use a "real" solution with clipboardData.setData for IE and execCommand for other browsers, which depends on approval of the user.</p></li>
  </ul>
  
  <p>Any idea how Google has tackled the clipboard problem?</p>