如何使用rowindex获取子节点的值,该值是动态创建的?获取行索引子节点的值
我试着用下面的代码,但错误出现"Unable to get the value of the property childnodeID"
var table = document.getElementById('tableID');
var Row = table.rows['childnodeID']; //error
Row.cells[0].innerText = i;
如何使用rowindex获取子节点的值,该值是动态创建的?获取行索引子节点的值
我试着用下面的代码,但错误出现"Unable to get the value of the property childnodeID"
var table = document.getElementById('tableID');
var Row = table.rows['childnodeID']; //error
Row.cells[0].innerText = i;
childnodeID
必须是number.Index永远不会成为一个string.It必须是数字
'childnodeID'是动态创建的子节点的ID。 –
然后找到那个孩子的索引,然后使用它 – PSR
'var Row1 = table.rows [5];'有错误 - 无法获得5的值,而使用table.rows,但我用table.childNode,错误出现在下一行'Row.cells [0] .innerText = i;'因为单元格值未定义。 –
'“childnodeID''不该” t是一个字符串;它应该是一个数字。 –