Document.onclick = function() {//} // We can use addEventlistener to add events to handle this problem Function event(dom, type, fn) {if(dom. AddEventListener) {dom. AddEventListener (type, dom. } else if (dom.attachevent) {dom.attachevent (type, Dom (fn)} else {' on '+ type] = fn}} / / stop the default behavior of the compatible method function getEvent (e) {return e | | window. The event} function getTarget(e) { return e || e.srcElement } function _preventDefault(e) { if(e.preventDefault) { e.preventDefault() } else { e.returnValue = fasle } }Copy the code