Concernant Event.cancelBubble, car les objets en HTML sont toutes des structures hiérarchiques, comme une table contient plusieurs tr, un TR contient plusieurs TD
La bulle est un événement qui peut être passé du nœud enfant au nœud père. , mais si vous ne pouvez pas télécharger l'événement.
exemple:
Copier le code du code comme suit:
<html>
<body>
<table id = "tablea" onclick = "alert ('tablea')">
<tr onClick = "tablea_rowa_click ()" >> ">
<td> Général </td>
</tr>
<tr onClick = "tablea_rowb_click ()">
<TD> Empêcher le téléchargement du message </td>
</tr>
</ table>
<p> </p>
</docy>
</html>
<! ---->
<script linguisse = "javascript">
<! -
Fonction tablea_rowa_click () {
alert ('tablea_rowa');
}
Fonction tablea_rowb_click () {
alert ('tablea_rowb');
event.cancelbubble = true;
}
// ->
</cript>
event.cancelbubble empêche l'incident de bouillonner, event.cancelbubble = true;
L'annulation du bouillonnement incident. déclenché;