0
(不能訪問動態控件時的document.getElementById(「textStopDesc11」)一個使用功能我能做些什麼?)JavaScript的動態數據控制誤差
功能:
AddPlannedStop()
{
var table = document.getElementById('tblPlannedStop');
var rowCount = table.rows.length;
var row = table.insertRow(rowCount);
var hidden = document.getElementById("hftblPlannedStoprowCount");
hidden.value = rowCount;
var btnDeleteIcon = "Images/deleteicon.png";
var cell1 = row.insertCell(0);
cell1.innerHTML ="<INPUT id='button" + (rowCount-1) + 0 +
"'onclick = 'deletePlannedStopRow()' style='WIDTH: 100%;" +
"BACKGROUND-POSITION: center; BACKGROUND-COLOR: menu;" +
"BACKGROUND-IMAGE: url(" + btnDeleteIcon + ")' type='button'>";
var cell2 = row.insertCell(1);
var element2 = document.createElement("input");
element2.type = "text";
element2.name = "txtStopDesc" + (rowCount - 1) + 1;
element2.id = rowCount + 1;
element2.style.width = "200px";
cell2.appendChild(element2);
var cell3 = row.insertCell(2);
return false;
}