addevent

function addEvent(a, b, c, d) {
a.addEventListener ? a.addEventListener(b, c, d) : a.attachEvent("on" + b, c)
}

function removeEvent(a, b, c, d) {
a.removeEventListener ? a.removeEventListener(b, c, d) : a.detachEvent("on" + b, c)
}

原文地址:https://www.cnblogs.com/rainbow661314/p/3315338.html