【发布时间】:2012-03-07 14:05:39
【问题描述】:
谁能告诉我如何给整个表格(表格的每一行)上色,到目前为止我只能给表格的第一行上色
我在jsp中的颜色函数:-
function changeColor(rowID){
var row = document.getElementById(rowID);
var alternateRow = document.getElementById(rowID +'_alt');
if(row!=null){
if(row.style.backgroundColor == '' || row.style.backgroundColor == '#ffffff'){
row.style.backgroundColor = "#009966";
return;
}
if(row.style.backgroundColor == '#009966'){
row.style.backgroundColor = "#ffffff";
return;
}
}
if(alternateRow!=null){
if(alternateRow.style.backgroundColor == '' || alternateRow.style.backgroundColor == '#ffffff'){
alternateRow.style.backgroundColor = "#009966";
return;
}
if(alternateRow.style.backgroundColor == '#009966'){
alternateRow.style.backgroundColor = "#ffffff";
return;
}
}
}
【问题讨论】:
标签: java javascript ajax jsp