How can I adjust the color of the entire table (every row of the table)? Currently, I can only change the color of the first row of my table.
Here is my color function in 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;
}
}
}