I have this editable table.
How I can save all data in a txt file (modified or not modified)?
var cell = null; //Focus Zero
function modify(obj) {
if (cell == null) {
cell = obj; //Create "Cell"
obj.innerHTML = "<input type='text' id='newtext' value='" + obj.innerHTML + "' onChange='save();' style='border:none'></input>";
document.getElementById("newtext").focus();
}
}
function save() //function for save the focus
{
var nuovoVal = document.getElementById("newtext").value;
cell.innerHTML = nuovoVal;
cell = null;
}
<TABLE border=2>
<TR>
<TD onclick="modify(this);">Denzel Washington</TD>
</TR>
<TR>
<TD onclick="modify(this);">Robert De Niro</TD>
</TR>
</TABLE>