Select the value of a TD on click to ease copy
<p>I want to select onclick the innerHTML of a td so the user can just do ctrl+C to copy the content.</p>

<p>I tried many combination and I can't find a way. However it seams to work on inputs with a simple <code>document.getElementById(id).select();</code></p>

<p>Adding a focus don't effect anything, and the .select() send and error:</p>

<blockquote>
  <p>document.getElementById(...).select is not a function</p>
</blockquote>

<p>So how can I do with a td element?
I don't mind if it's not working on IE.</p>

<p>Or if possible, directly copying the text.</p>