jquery - Copy Table Cell To Clipboard javascript -
how copy cell clipboard? want user click in cell , cell copied clipboard. i've tried this:
<td onclick="clipboard();">hi</td> <script language="javascript"> function clipboard() { holdtext.innertext = copytext.innertext; copied = holdtext.createtextrange(); copied.execcommand("copy"); } </script>
<table id="table" class="responsive" style="width:1000px;"> <tbody> <tr> <th>field display-name</th> <th>html identifier</th> <th>is required</th> <th>data type</th> <th>html type</th> <th>html attribute</th> <th>field type</th> <th>event type</th> </tr> <tr> <td>punitprice_pp</td> <td>.pricestor</td> <td></td> <td>price & currency</td> <td>div</td> <td>value</td> <td>raw</td> <td>onload</td> </tr> </tbody> </table>
try attribute contenteditable="true" , try following link copy clipboard contents, execute ctrl + c
Comments
Post a Comment