Auto complete doesn't work on dynamically add textboxes

Auto complete doesn't work on dynamically add textboxes

  1.             $("#table tr td:last").live("keydown", function (e) {
  2.                 var keyCode = e.keyCode || e.which;
  3.                 if (keyCode == 9) {
  4.                     $("#table tr:last").after("<tr><td><input type='text' style='width: 140px'/></td><td><input type='text' style='width: 140px'/></td><td><input type='text' id='legid' class='acomp' style='width: 140px'/></td><td><input type='text' style='width: 140px'/></td><td><input type='text' style='width: 140px'/></td><td><input type='text' style='width: 140px'/></td></tr>");
  5.                 }
  6.             });
  7.         });

  1.         function SearchText() {
  2.             $("#table .acomp").autocomplete({
  3.                 source: function (request, response) {
  4.                     $.ajax({
  5.                         type: "POST",
  6.                         contentType: "application/json; charset=utf-8",
  7.                         url: "WebService.asmx/GetAutoCompleteData",
  8.                         data: "{'kwrds':'" + $('.acomp').val() + "'}",
  9.                         dataType: "json",
  10.                         success: function (data) {
  11.                             response(data.d);
  12.                             // $('#<%= legid.ClientID %>').find("tr").find("td").val;
  13.                             
  14.                         },
  15.                         error: function (result) {
  16.                             alert(result);
  17.                         }
  18.                     });
  19.                 }
  20.             });
  21.         }


I tried with ID and using a class but I still cannot retrieve the value out of the dynamically created textboxes.