Jump to content

copy the content of a table with a button


x_maras

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.