test.rows[1].cells[1].style.backgroundColor="blue";在style中bgcolor叫“backgroundColor ”

解决方案 »

  1.   

    <TABLE id=test name =test>
    <TR >
    <TD>1</TD>
    <TD>11111111111111111</TD>
    </TR>
    <TR> <TD id=row1 bgcolor=red>11111111111</TD>
    <TD>11111111111111111</TD>
    </TR>
    <TR>
    <TD>2</TD>
    <TD>222222</TD>
    </TR>
    </TABLE><SCRIPT LANGUAGE="JavaScript">
    <!--
    test.rows[1].cells[1].style.bgcolor="blue"//这样行
    //-->
    </SCRIPT>
    row1.style.background="blue"
      

  2.   

    background背景图片或背景颜色都可以的。