标签:
//兼容IE和非IE浏览器(不兼容Ie老版本)
function addEvent(ele, event_name, func){
if(window.attachEvent){
ele.attachEvent(event_name, func);
}
else{
event_name = event_name.replace(/^on/, "");
ele.addEventListener(event_name, func, false); //默认事件是冒泡
}
}
标签:
原文地址:http://www.cnblogs.com/liuzhaoqin/p/4974618.html