$(\'#buttonadd\').click(function(){ if ($counter < 10) { $counter++; $countonlyadd++; $(\
Questions are:
table
Think about these questions and if result is "no", that's the problem
If you have <table> wrapper, change
$('#buttondiv').
to
$('#buttondiv table').