呵呵,这问题有趣<div style="background:#ECD8E9" onclick="alert(this.style.background)">11111111111111111</div>具体的我说不大明白,不过反正不管大写小写,系统里存的是小写

解决方案 »

  1.   

    是大小写的问题啦
    很简单的方法。你写一个form 里面含有大写的颜色数据。然后你用alert查看这个form的innerHTML你就会发现那些大写的颜色值全变小写了。
      

  2.   

    用rgb可通用至mozilla板本...<table border=1>
    <tr onclick="if(this.style.backgroundColor.replace(/ /g,'')!='rgb(255,0,0)'){this.style.backgroundColor='rgb(255,0,0)'} else {this.style.backgroundColor='rgb(236,216,233)'}"><td>1111111111111111</td></tr>
    </table>备注:
    mozilla在background-color上的设置将解析为rgb(xx, yy, zz)的,注意","后面有空格,而ie没有空格。