Regarding event.cancelBubble, since objects in HTML are hierarchical structures, for example, a Table contains multiple TRs, and a TR contains multiple TDs
Bubble is an event that can be passed from child nodes to parent nodes, such as mouse clicks. A TD is created, and the current event.srcElement is this TD. However, this bubbling mechanism allows you to intercept the click event from TR or Table, but if you event.cancelBubble, the event cannot be uploaded.
Example:
General |
< td width="106">Block message upload
body>
event.cancelBubble prevents event bubbling, event.cancelBubble=true;
Cancels event bubbling, in IE In the event mechanism, the triggering event will be uploaded step by step from the child element to the parent element. That is to say, if the child element triggers a click event, the click event of the parent element will also be triggered; event.cancelBubble=true; can stop the event from continuing. Upload to add that Ie's event delivery is from bottom to top: