AddEventListener has three parameters: the first parameter represents the event name (without on, such as "click"), the second parameter represents the function to receive event handling, and the third parameter is usecapture, which is explained in this article.
The above is the code we tested, according to the display of info to determine the order of triggering, there are three AddEventListener, and usecapture optional value is true and false, so 2*2*2, you can draw 8 different programs.
When all is false, the triggering sequence is: Indiv, Middlediv, Outdiv;
When all is true, the triggering order is: Outdiv, Middlediv, Indiv;
Outdiv is true, when the other is false, the triggering order is: Outdiv, Indiv, Middlediv;
Middlediv is true, when the other is false, the triggering order is: Middlediv, Indiv, Outdiv;
......
Finally, the following conclusions are drawn:
The triggering order of true is always before false;
If more than one is true, then the outer layer is triggered before the inner;
If more than one is false, the inner trigger precedes the outer layer.
Three parameters of AddEventListener