//阻止事件冒泡: if(e.stopPropagation){ e.stopPropagation(); }else{ e.cancelBubble = true; } //对DOM中的ELEMENT元素绑定事件: function addEvent(/*dom*/ el, /*string*/ type, /*function*/ handler){ if(!el){return ;} if(el.addEventListener){ el.addEventListener(type,handler,false); }else if(el.attachEvent){ el.attachEvent("on"+type,handler); } }