javascriptは表のtdの値を取得します.
721 ワード
function fetchTdValue(tableId){
var table = document.getElementById(tableId);
var trLength = table.rows.length;
var tdLength = 0;
var tr;
var td;
var tdValue = "";
if(trLength){
for(var i = 1;i<trLength;i++){
tr = table.rows[i];
tdLength = tr.cells.length;
if(tdLength){
for (var j=2;j<tdLength;j++){
td = tr.cells[j];
tdValue = tdValue + td.innerHTML+";";
}
}
tdValue = tdValue +"@@@";
}
}
return tdValue;
}