Regarding Event.cancelBubble, because the objects in HTML are all hierarchical structures, such as one table contains multiple TR, one TR contains multiple TDs
Bubble is a event that can be passed from the child node to the father node. For example, the mouse clicks a TD. The current event.srcelement is this TD, but this bubbling mechanism allows you to intercept this click event from TR or Table, but if you You can't upload the event.
example:
Copy code code as follows:
<html>
<body>
<table id = "tablea" onClick = "Alert ('Tablea')">
<tr Onclick = "tablea_rowa_click ()">> ">
<TD> General </td>
</tr>
<tr Onclick = "tablea_rowb_click ()">
<TD> Prevent message Upload </td>
</tr>
</table>
<p> </p>
</body>
</html>
<! ---->
<script language = "javascript">
<!--
Function tablea_rowa_click () {
alert ('tablea_rowa');
}
Function tablea_rowb_click () {
alert ('tablea_rowb');
event.cancelbubble = true;
}
//->
</script>
event.cancelbubble prevents the incident from bubbling, event.cancelbubble = true;
Canceling the incident bubbling. In the IE event mechanism, triggers will be uploaded step by step from sub -element to parent elements. That is to say, if the sub -element triggers the click event, the clicks of the parent element will also be triggered; event. Cancelbubble = TRUE; you can stop the event and continue uploading a supplement. IE event transmission is from bottom to top: