attachEvent是ie6的事件绑定方法
addEventListener是firefox的事件绑定方法
其中事件名如onclick,在firefox下要用click
if(document.frames){
document.frames["HtmlEditor"].document.attachEvent('onclick',function(){ISNEEDSAVE = true;});
}else{
var iframe = document.getElementById('HtmlEditor');
iframe.contentWindow.document.addEventListener("click",function(){ISNEEDSAVE = true;},false);
}

文章来源:
http://blog.csdn.net/scnu_xiaokun/archive/2009/04/07/4054122.aspx