事件监听

window.onload = function() {
var oneClick = function() {
alert("第一个事件");
};
var twoClick = function() {
alert("第二个事件");
};
var threeClick = function() {
alert("第三个事件");
}

var btn = document.getElementById("event");
btn.addEventListener("click", oneClick);
btn.addEventListener("click", twoClick);
btn.addEventListener("click", threeClick);
btn.removeEventListener("click", threeClick);


}
posted @ 2017-08-31 16:15  ermao的博客  阅读(176)  评论(0编辑  收藏  举报