i am working on a assignment, in which i have to first display a html table using data from the database (i'm using PHPMyadmin).

From that table user will select/click a particular row. Then that row should appear in another html table (i used jquery append to do that). Now i need to remove that row from the second table, so added extra "td" in the append function named "remove". After a click on that "remove" that whole row should be removed from that table.

i tried this...

//jquery code

$(selector from the 1st table).click(function(){ 

//after clicking that row should be added to 2nd table


// now row is appended to 2nd table.

//click function for 2nd table which will remove row.

$("tbody-id" td:last).click(function(){

$(this).parent.remove();  // "tr" of clicked "td"


but this doesnt work.
how to do this?
pls help