Change value in cell

Change value in cell

Hi, my target (by button click) is check if in a table there is an Item: if yes I would like to add +1 in my quanty if no I add a new row. 

I'm able to check if there is the Item value in the table, and I'm able to add a new row if there is the ItemValue, but I'cant add a +1 in the quantity if the item is in the table. 

my code:
  1. $('.comanda-button').click(function(){ 
  2.              label_btn=$(this).attr("value"); 
  3.              id=$(this).attr("id");
  4.              $('#conto tr').find('td:first-child').each(function() {
  5.                    test=$(this).text(); 
  6.                    if(test===id){ 
  7.                        trovato='1'; 
  8.                         qta=$('td:eq(2)').text(); 
  9.                        qta=parseInt(qta)+1; 
  10.                         $('td:eq(2)').text(qta); 
  11.                          return false;
  12.                     }
  13.  }); 
  14.  if(trovato==='0'){ //add a new row
  15.  $("#conto").find('tbody').append(''+id+''+label_btn+''+qta+'');
  16.  trovato='0'; 
  17.  } });
#conto is the id of the table.
With this code I change the vale of the first row and did not work the istruction qta=parseInt(qta)+1;

thanks