<select id=selectColor name="select" onClick="">
          <option style="color: #FF0000; background-color: #FF0000">red</option>
          <option style="color: #FF0000; background-color: #FF8700">orange</option>
</select>
<SCRIPT event=onchange for=selectColor language=JavaScript>
//如何取到上面option的背景颜色呢?
alert(this.options[this.selectedIndex].style.backgroundColor)

解决方案 »

  1.   

    非常感谢: bencalie!还有个问题的说
    <table width="450" border="0" height="65">
              <form name="form1" method="post" action=""><tr> 
                <td align="center">
                  
                    <select name="select">
                      <option style="background-image: url(images/1.gif)">111111111</option>
                      <option>2</option>
                      <option>3</option>
                      <option>4</option>
                      <option>5</option>
                    </select>
                  
                </td>
              </tr></form>
              <tr>
                <td align="center" style="background-image: url(images/1.gif)">&nbsp;</td>
              </tr>
            </table>
    一共两行,都加入了样式表(背景图)可是第一行不显示背景,第二行能正常显示!
    现在想显示 背景的图片!如何操作?
      

  2.   

    再次感谢!
    那用网页 能否做出类似WORD中的“格式”“字体”“下划线”
    那个下拉菜单效果???
    谢谢: Bencalie