JavaScript, stop additional event listeners

前端 未结 5 1563
盖世英雄少女心
盖世英雄少女心 2021-01-12 01:41

Imagine I have this code:

var myFunc1 = function(event) {
    alert(1);
}
var myFunc2 = function(event) {
    alert(2);
}

element.addEventListener(\'click\'         


        
5条回答
  •  执笔经年
    2021-01-12 02:11

    The DOM Level 3 method event.stopImmediatePropagation is exactly what I need here. Unfortunately, it's not currently implemented in any browser (that I know of).

提交回复
热议问题