document.getElementById("dxlb").style.font.fontColor="red"好像没有用啊?

解决方案 »

  1.   

    document.getElementById("dxlb").style.color="red"
      

  2.   

    document.getElementById("dxlb").style.color="red"ordocument.getElementById("dxlb").runtimeStyle.color="red"
      

  3.   

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <TITLE> New Document </TITLE>
    <META NAME="Generator" CONTENT="EditPlus">
    <META NAME="Author" CONTENT="">
    <META NAME="Keywords" CONTENT="">
    <META NAME="Description" CONTENT="">
    <style>
    .table1 {font-family: "宋体"; font-size: 9pt;;color:red}.table2 {font-family: "宋体"; font-size: 14pt;color:yellow}
    </style>
    <SCRIPT LANGUAGE="JavaScript">
    <!--
    function test()
    {
    document.all("table1").className = "table2";
    }
    //-->
    </SCRIPT>
    </HEAD><BODY>
    <TABLE id="table1" border="1" class="table1">
    <TR>
    <TD>aaaa</TD>
    <TD>aaa3</TD>
    <TD>4</TD>
    </TR>
    </TABLE>
    <input type=button value="更改" onclick="test()">
    </BODY>
    </HTML>