Necesito ayuda con esta función de JavaScript que hice. Funciona, pero siempre me alerta con:TypeError: row no está definido
"TypeError: row is undefined"
cuando lo ejecuto.
Aquí está mi código:
function checkRow(tableID){
try{
var table = document.getElementById(tableID);
var rowCount = table.rows.length;
for(var i = 1; i <= rowCount; i++){
var row = table.rows[i];
var id = row.cells[1].innerHTML;
if(i != id){
document.getElementById(tableID).rows[i].cells[1].innerHTML = i;
}
}
}catch(e){
alert(e);
}
}
¿Qué línea es el error en? – JoshRagem