第一種方法:
復制代碼 代碼如下:
第二種方法:
function submitData() {
var tb = document.getElementById(IDArray[0]);
if (tb.hasChildNodes) {
if (tb.childNodes[0] != null) {
var rowCount = tb.childNodes[0].childNodes.length;
for (var i = 1; i < rowCount; i++) {
var child = tb.childNodes[0].childNodes[i];
var id = rowCount[i].cells[1].innerHTML;
var name = child.childNodes[1].innerHTML;
var oDropDownList = child.childNodes[2].childNodes[0];
var oText = oDropDownList.options[oDropDownList.selectedIndex].text;
var oValue = oDropDownList.options[oDropDownList.selectedIndex].value
}
}
}