<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> </head> <body> <button id="btn">点我</button> <script> function aaa() { alert('a') } function bbb() { alert('b') } function myAddEvent(obj, sEvent, fn) { if (obj.attachEvent) { obj.attachEvent("on" + sEvent, fn) } else { obj, addEventListener(sEvent, fn, false) } } window.onload = function () { var btn = document.getElementById("btn"); myAddEvent(btn, 'click', aaa); myAddEvent(btn, 'click', bbb) } </script> </body> </html>