form1.select1.options[1].style.backgroundColor="green";
form1.select1.options[1].style.fontWeight="bold";
form1.select1.options[1].style.fontSize="20px"

解决方案 »

  1.   

    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>select问题</title>
    </head><body>
    <form name="form1" method="post" action="">
      <select name="select1" size="10">
        <option value="a">aaaaaaa</option>
        <option value="b">bbbbbbb</option>
        <option value="c">ccccccc</option>
      </select>
    </form></body>
    <script language="JavaScript">
    <!--
    //改变字体颜色(以下代码正确)
    form1.select1.options[0].style.color="red";
    //改变背景颜色(以下代码错误)
    form1.select1.style.backgroundColor="green";
    //改变大小
    form1.select1.style.fontSize="40px";
    //加粗
    form1.select1.style.fontWeight="bold";-->
    </script>
    </html>
      

  2.   

    form1.select1.options[1].style.backgroundColor="green";
    form1.select1.options[1].style.fontWeight="bold";
    form1.select1.options[1].style.fontSize="20px"
      

  3.   

    Sorry,更正一下,字体和加粗都针对select<html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>select问题</title>
    </head><body>
    <form name="form1" method="post" action="">
      <select name="select1" size="10">
        <option value="a">aaaaaaa</option>
        <option value="b">bbbbbbb</option>
        <option value="c">ccccccc</option>
      </select>
    </form></body>
    <script language="JavaScript">
    <!--
    //改变字体颜色(以下代码正确)
    form1.select1.options[0].style.color="red";
    //改变背景颜色(以下代码错误)
    form1.select1.options[1].style.backgroundColor="green";
    //改变大小
    form1.select1.style.fontSize="40px";
    //加粗
    form1.select1.style.fontWeight="bold";
    -->
    </script>
    </html>