Создание кнопки:
var button=document.createElement("input");
                 	button.setAttribute("type","button");
                 	button.setAttribute("value","Change");
                 	button.id=data.persons[i].person.id;
                 	button.onclick=function() { change(this.id);};
                 	var newCell=newRow.insertCell(3);
                 	newCell.appendChild(button);
Обработка:
function change(id) {
    	
    	 var change=document.createElement("input");
     	 change.setAttribute("type", "text");
     	 change.setAttribute("id", id);