87,996
社区成员




<html>
<body>
<input type="button" id="button_test" value="测试" />
<script type="text/javascript">
function addEventHandler(target, type, func) {
if (target.addEventListener)
target.addEventListener(type, func, false);
else if (target.attachEvent)
target.attachEvent("on" + type, func);
else target["on" + type] = func;
}
addEventHandler(document.getElementById("button_test"), "click", function () { alert(1); });
addEventHandler(document.getElementById("button_test"), "click", function () { alert(2); });
</script>
</body>
</html>