From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/fr/web/api/event/cancelbubble/index.html | 53 ++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 files/fr/web/api/event/cancelbubble/index.html (limited to 'files/fr/web/api/event/cancelbubble') diff --git a/files/fr/web/api/event/cancelbubble/index.html b/files/fr/web/api/event/cancelbubble/index.html new file mode 100644 index 0000000000..fad1a2ca95 --- /dev/null +++ b/files/fr/web/api/event/cancelbubble/index.html @@ -0,0 +1,53 @@ +--- +title: Event.cancelBubble +slug: Web/API/Event/cancelBubble +tags: + - API + - Annulation + - DOM + - Evènement + - Propagation + - Propriétés +translation_of: Web/API/Event/cancelBubble +--- +

{{APIRef("DOM Events")}}

+ +

La propriété Event.cancelBubble est un alias historique de {{domxref("Event.stopPropagation()")}}. Définir sa valeur à true (vrai) avant le renvoi à partir d'un gestionnaire d'évènements empêche la propagation de l'évènement. Dans les implémentations les plus tardives, cette définition à false (faux) ne fait rien. Voir {{anch("Compatibilité des navigateurs")}} pour plus de détails. 

+ +

Syntaxe

+ +
event.cancelBubble = bool;
+var bool = event.cancelBubble;
+
+ +

Exemple

+ +
elem.onclick = function(e) {
+ // fais des choses sympas ici
+  e.cancelBubble = true;
+}
+ +

Spécifications

+ + + + + + + + + + + + + + +
SpécificationStatutCommentaire
{{SpecName('DOM WHATWG', '#dom-event-cancelbubble', 'cancelBubble')}}{{Spec2('DOM WHATWG')}} 
+ +

Compatibilité des navigateurs

+ + + +

{{Compat("api.Event.cancelBubble")}}

+ +
 
-- cgit v1.2.3-54-g00ecf