How to retrieve value of input type in a dynamic table
function neeminhoud3(){
var tabel = document.getElementById('tableDiagnose');
var rijen = tabel.rows.length;
for (i = 0; i < rijen; i++){
var inputs = tabel.rows.item(i).getElementsByTagName("input");
var inputslengte = inputs.length;
for(var j = 0; j < inputslengte; j++){
var inputval = inputs[j].value;
alert(inputval);
}
}
}
if you want to get all input fields out of your table
Well you're not even trying to access the value...
alert(tbl.rows[rCount-1].cells[0].children[0].value);
You need to access the input object WITHIN the cell. You're just looking at the HTML within it.
Try tbl.rows[rCount - 1].cells[0].children[0].value;
alert(tbl.rows[rCount - 1].cells[0].getElementsByTagName("input")[0].value);