I wanted to use DOM elements instead of innerHTML so I changed this
cell3.innerHTML = '<input type="button" class="blue" onclick="edit(this.id)" value="Edit" id=edit-button' + (i + 1) + '></input>';
into this
var newEl = document.createElement("input");
newEl.className ="blue";
newEl.value= "Edit";
newEl.id="edit-button " + (i + 1);
newEl.type="button";
cell3.appendChild(newEl);
newEl.onclick=function() {edit(newEl.id)};
how do I fix the argument of the function edit becoming null/empty?