x_maras Posted October 2, 2009 Share Posted October 2, 2009 Hi, I have a table with two cells in each raw, in the first cells some content and in the second a button showing some charts. I want to make a button, so someone can copy the whole content into clip board. I thought to place an id to each cell and then copy the content of the cells... There is where I need some help. I found some javascript functions, but not working right for me. Any help would be appreciated Link to comment https://forums.phpfreaks.com/topic/176245-copy-the-content-of-a-table-with-a-button/ Share on other sites More sharing options...
johnsmith153 Posted October 9, 2009 Share Posted October 9, 2009 for the table, instead of putting: <td>Hello</td> do: <td><div id="helloId">Hello</div></td> <script> function getData() { alert(document.getElementById('helloId').innerHTML); } </script> call the function to show the data held inside the div Link to comment https://forums.phpfreaks.com/topic/176245-copy-the-content-of-a-table-with-a-button/#findComment-933830 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.