【IT168技术文档】
上面这行代码在Firefox 下能正常运行,然后放在IE下却不能运行.因为在IE下这行代码没有生效document.getElementById("divid").setAttribute("onmouseout", "javascript:this.style.backgroundColor='#fff'");
给上面一行代码稍作修改就能使它兼容在IE和FF下.
document.getElementById("divid").onmouseout = function(){ document.getElementById("divid").style.backgroundColor = "#fff"; }