Where is the mistake?

var i = 0; $(document).ready(function() { $('#button').click(function() { $("#tableCoppy").clone().appendTo("#tablePaste"); $('#tablePaste').find('#tableCoppy').attr('id', 'div' + i); }); }); 
  • Greetings. And what exactly is the problem? - Maxim Bogdanov

1 answer 1

  1. Probably the fact that you do not need to add one table inside another, you must add tbody inside the table or tr inside tbody.

  2. Id should be unique on the page, and by code it is obvious that it is not.