title: Copy selected text to the clipboard WITHOUT using flash - must be cross-browser
body: <p>I want to have a button which selects the text in a <code>textarea</code> and copies it to the clipboard.  I can't seem to find any solutions which work in all browsers and don't use flash.</p>
  
  <p>Surely this is doable?  I've seen it all over the place but I guess they use flash, which I really want to stay away from if possible as some people don't have it.</p>
  
  <p>This is what I have so far - it just selects the text:</p>
  
  <pre><code>function copyCode() {
    $("#output-code").focus();
    $("#output-code").select();
  }
  </code></pre>
  
  <p>(The focus is not strictly necessary)</p>