title: Copy html table row and append in other table
body: <p>I have two tables [Source: table1, Destination:table2] with 3 columns each (checkbox, value1, value2).
  On selecting a checkbox in table1, jquery should copy that particular row and append it to table2 while deleting it from table1 at the same time. This action should also work from table2 to table1. I wrote a script but its not working. It is copying and deleting from table1 and appending to table2 but when I select a checkbox from the newly dynamically added table2 row, somehow it is not getting appended to table1.</p>
  
  <pre><code>    &lt;script&gt;
      $(document).ready(function() {
          $("#table1 tr input:checkbox").click(function() {
              $('#table2').append('&lt;tr&gt;&lt;td&gt;&lt;input type="checkbox" name="'+$(this).attr("name")+'" value="'+$(this).val()+'"&gt;&lt;/td&gt;&lt;td&gt;'+$(this).attr("name")+'&lt;/td&gt;&lt;td&gt;'+$(this).val()+'&lt;/td&gt;&lt;/tr&gt;');
              $(this).parent().parent().remove();
          });         
  
          $("#table2 tr input:checkbox").click(function() {
              $('#table1').append('&lt;tr&gt;&lt;td&gt;&lt;input type="checkbox" name="'+$(this).attr("name")+'" value="'+$(this).val()+'"&gt;&lt;/td&gt;&lt;td&gt;'+$(this).attr("name")+'&lt;/td&gt;&lt;td&gt;'+$(this).val()+'&lt;/td&gt;&lt;/tr&gt;');
              $(this).parent().parent().remove();
          }); 
      });
      &lt;/script&gt;
  </code></pre>
  
  <p>Am I missing anything? How do I fix this thing?</p>