```
<script>
window.onload = function () {
var addEvent = (function (...args) {
getEvent.call(this)
if (window.addEventListener) {
return function (...args) {
ele.addEventListener(type, getEvent)
}
} else if (window.attachEvent) {
return function (...args) {
ele.attachEvent("on" + type, getEvent)
}
}
})()
var ele = document.getElementsByClassName('Oul')[0]
var type = "click"
addEvent(ele, type, getEvent)
function getEvent(e) {
if (e) {
console.log(e.target)
}
}
}
</script>
```
网友评论