$(function(){
var namecounter = 0
$("#getitem").click(function(){
namecounter++
var txtval = $("#txt").val();
$('<tr><td><input type="button" name="txt'+ namecounter +'" value="remove" /><input type="text" id="txt'+ namecounter +'a" name="txt'+ namecounter +'a" value="'+txtval+'"/></td><td></td><td></td></tr>').appendTo('#pasok');
});
$(":button[name^='txt']").click(function(){
var currentValue = $(this);
var target = $("#" + currentValue.attr("id") + "a");
$(target).remove();
});
});
How to delete created element via JQUERY?