Note that there are some explanatory texts on larger screens.

plurals
  1. POCopy innerHtml of Table cell into the clipboard without flash (like in google docs)
    text
    copied!<p>I have an html Table where I want my users to copy the innerHtml of the table cells into the clipboard. I am aware that the browser is sandboxed and that this is not allowed on many browsers. </p> <p>I have searched many similar questions on SO and I am aware that my question will be considered a duplicate by many (however I believe that the question is relevant again):</p> <ol> <li><a href="https://stackoverflow.com/questions/1242481/copy-to-clipboard-using-javascript?lq=1">Copy to clipboard using Javascript</a></li> <li><a href="https://stackoverflow.com/questions/400212/how-to-copy-to-the-clipboard-in-javascript">How do I copy to the clipboard in JavaScript?</a></li> <li><a href="https://stackoverflow.com/questions/16294365/way-to-copy-to-clipboard-in-the-pure-javascript">Way to copy to clipboard in the PURE javascript?</a></li> </ol> <p>The answers to the questions above can be summerized in:</p> <ul> <li><p>In IE is possible to copy an element into the clipboard by using the api like so:</p> <pre><code>CopiedTxt = element.createTextRange(); CopiedTxt.execCommand("Copy"); </code></pre></li> <li><p>It is not possible to do it Cross-Browser without flash.</p></li> </ul> <p><strong>The reason why I decided to ask the question again</strong> is two-fold: 1. The answers and questions are already somewhat old (1-2 years) 2. Google docs manages to copy selected cells in the spreadsheet on Firefox to the clipboard, and without Flash.</p> <p>So there has to be a way to perform this operation on Firefox and Webkit without the use of Flash. Does anybody have any idea of how the guys at google managed to implement this functionality on their spreadsheet?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload