成绩系统在抄写成绩的时候容易串行串列,加了个高亮显示一列的功能,先上图
html代码
<td align="center" class="topbg"><input type="checkbox" name="chkb<%=i%>" onclick="showCol(<%=i%>,this.checked)"></td>
js代码
function showCol(iCol,checked)
{
var oTable=document.getElementsByTagName('table')[0];
for (i=1;i < oTable.rows.length-1 ; i++){
if(checked){
oTable.rows[i].cells[iCol+2].style.backgroundColor = "#C6E3FF";
}
else{
oTable.rows[i].cells[iCol+2].style.backgroundColor = "";
}
}
}