Hi,
I have a table automatically generated via PHP (about 200 or so lines of code). Each table row has an ID and an onclick function onclick="copyRow(this.id);"
I have a <div id="placeholder"></div> in the page, and when I click a table row, I want to place that table row in the div placeholder, i.e.
So if I click 10 different rows, then all these 10 rows will appear in this placeholder. I've experimented with a few things, but have been unsuccessful.
Can someone give me some pointers as to how to do this?
I have a table automatically generated via PHP (about 200 or so lines of code). Each table row has an ID and an onclick function onclick="copyRow(this.id);"
I have a <div id="placeholder"></div> in the page, and when I click a table row, I want to place that table row in the div placeholder, i.e.
Code:
function copyRow(id)
{
var placeholder = document.getElementById('placeholder');
var tableRow = document.getElementById(id);
// create table if no table rows already exists
// if row not already in table, then add it to table
}
So if I click 10 different rows, then all these 10 rows will appear in this placeholder. I've experimented with a few things, but have been unsuccessful.
Can someone give me some pointers as to how to do this?