事件对象——跨浏览器的事件对象
var eventUntil={ addHandler:(element,type,handler)=>{ if(element.addEventListener){ element.addEventListener(type,handler,false); }else if(element.attachEvent){ element.attachEvent("on"+type,handler); }else{ element["on"+type]=handler; }, getEvent:(event)=>{ return event?event:window.event; }, getTarget:(event)=>{ return event.target||event.srcElement; }, preventDefault:(event)=>{ if(event.preventDefault){ event.preventDefault(); }else{ event.returnValue=false; } }, removeHandler:(element,type,handler)={ //some code }, stopPropagation:(event)=>{ if(event.stopPropagation){ event.stopPropagation(); }else{ event.cancelBubble=true; } } };