JS --- DOM --- stop the event bubbling and event bubbling

Event bubbling: a plurality of elements are nested, hierarchical relationships, these elements are registered in the same event, if the event which triggered the elements, the event outside elements automatically triggers
 
How to stop event bubbling: 
1. window.event.cancelBubble = true; IE specific, Google support does not support Firefox
2. e.stopPropagation (); Google and Firefox support,

There are function-compatible learning later

Guess you like

Origin www.cnblogs.com/jane-panyiyun/p/12020547.html