programming-examples/js/Htmldom/Create a function to update the content of a specific cell of a table.js
2019-11-15 12:59:38 +01:00

8 lines
356 B
JavaScript

function changeContent()
{
rn = window.prompt("Input the Row number(0,1,2)", "0");
cn = window.prompt("Input the Column number(0,1)","0");
content = window.prompt("Input the Cell content");
var x=document.getElementById('myTable').rows[parseInt(rn,10)].cells;
x[parseInt(cn,10)].innerHTML=content;
}