--- title: GlobalEventHandlers slug: Web/API/GlobalEventHandlers tags: - API - DOM - Gestionnaires d'évènements - évènements translation_of: Web/API/GlobalEventHandlers ---
L'interface GlobalEventHandlers
décrit les gestionnaires d'évènements usuels de nombreuses interfaces comme {{domxref("HTMLElement")}}, {{domxref("Document")}}, {{domxref("Window")}} ou {{domxref("WorkerGlobalScope")}} pour les Web Workers. Chacune de ces interfaces peut implémenter plus de gestionnaires d'évènements.
GlobalEventHandlers
est une interface brute et aucun objet de ce type ne peut être créé.
Les propriétés des évènements, de la forme onXYZ
, sont définies sur {{domxref("GlobalEventHandlers")}} et implémentées par {{domxref("HTMLElement")}}, {{domxref("Document")}}, {{domxref("Window")}} et {{domxref("WorkerGlobalScope")}} pour les Web Workers.
onwheel
à la place.Cette interface ne définit aucune méthode.
Spécification | Statut | Commentaire |
---|---|---|
{{SpecName("Selection API",'', 'Extension to GlobalEventHandlers')}} | {{Spec2('Selection API')}} | Ajoute onselectionchange. |
{{SpecName('Pointer Lock', '#extensions-to-the-document-interface', 'Extension of Document')}} | {{Spec2('Pointer Lock')}} | Ajouteonpointerlockchange et onpointerlockerror sur{{domxref("Document")}}. Est implémenté expérimentalement GlobalEventHandlers . |
{{SpecName('HTML WHATWG', '#globaleventhandlers', 'GlobalEventHandlers')}} | {{Spec2('HTML WHATWG')}} | Pas de changement depuis le précédent {{SpecName("HTML5.1")}}. |
{{SpecName('HTML5.1', '#globaleventhandlers', 'GlobalEventHandlers')}} | {{Spec2('HTML5.1')}} | Instantané de {{SpecName("HTML WHATWG")}}. onsort ajouté depuis {{SpecName("HTML5 W3C")}}. |
{{SpecName("HTML5 W3C", "#globaleventhandlers", "GlobalEventHandlers")}} | {{Spec2('HTML5 W3C')}} | Instantané de {{SpecName("HTML WHATWG")}}. Création de GlobalEventHandlers . |
{{CompatibilityTable}}
Fonctionnalité | Firefox (Gecko) | Chrome | Edge | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|---|
Basic support | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} |
oncanplay , oncanplaythrough , ondurationchange , onemptied , onended , onloadeddata , onloadedmetadata , onloadstart , onpause , onplay , onplaying , onprogress , onratechange , onseeked , onseeking , onstalled , ontimeupdate , onvolumechange , onwaiting |
{{CompatGeckoDesktop(1.9.1)}} | {{CompatVersionUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} |
onsuspend |
{{CompatGeckoDesktop(1.9.2)}} | {{CompatVersionUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} |
ondrag , ondragend , ondragenter , ondragleave , ondragover , ondragstart , ondrop |
{{CompatGeckoDesktop(1.9.1)}} | {{CompatVersionUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} |
onmouseenter , onmouseleave |
{{CompatGeckoDesktop(10)}} | {{CompatChrome(30.0)}} | {{CompatUnknown}} | 5.5 | 17 | {{CompatUnknown}} |
ondragexit |
{{CompatNo}} | {{CompatNo}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} |
oncancel |
{{CompatNo}} | {{CompatVersionUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} |
onclose |
{{CompatNo}} | {{CompatVersionUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} |
oncuechange |
{{CompatNo}} | {{CompatVersionUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} |
onmousewheel |
{{CompatNo}} | {{CompatVersionUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} |
onsort {{experimental_inline}} |
{{CompatNo}} | {{CompatNo}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} |
onmozfullscreenchange , onmozfullscreenerror {{non-standard_inline}} |
{{CompatVersionUnknown}} | {{CompatVersionUnknown}} {{property_prefix("-webkit")}} {{CompatVersionUnknown}} (unprefixed) |
{{CompatNo}} | {{CompatNo}} | {{CompatNo}} | {{CompatNo}} |
onpointerlockchange , onpointerlockerror |
{{CompatGeckoDesktop(10)}}[1] | {{CompatVersionUnknown}}[2] {{property_prefix("-webkit")}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} |
onpointercancel , onpointerdown , onpointerup , onpointermove , onpointerout , onpointerover , onpointerenter , onpointerleave |
{{CompatVersionUnknown}}[3] | {{CompatChrome(55.0)}} | {{CompatVersionUnknown}} | 10 | {{CompatUnknown}} | {{CompatUnknown}} |
onselectionchange |
{{CompatGeckoDesktop(43)}}[4] | {{CompatNo}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} |
ontouchend , ontouchcancel , ontouchmove , ontouchstart |
{{CompatUnknown}} | {{CompatVersionUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} |
animationstart , animationend , animationcancel , animationiteration |
{{CompatGeckoDesktop(51)}} | {{CompatVersionUnknown}} {{property_prefix("-webkit")}} {{CompatVersionUnknown}} (unprefixed) |
{{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} |
ongotpointercapture , onlostpointercapture |
{{CompatUnknown}} | {{CompatChrome(57.0)}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatOpera(44)}} | {{CompatUnknown}} |
onauxclick |
{{CompatGeckoDesktop(53)}} | {{CompatVersionUnknown}} | {{CompatNo}} | {{CompatNo}} | {{CompatNo}} | {{CompatNo}} |
onwheel |
{{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} |
Fonctionnalité | Android Webview | Edge | Firefox Mobile (Gecko) | Android | IE Mobile | Opera Mobile | Safari Mobile | Chrome for Android |
---|---|---|---|---|---|---|---|---|
Basic support | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatVersionUnknown}} |
ondrag , ondragend , ondragenter , ondragleave , ondragover , ondragstart , ondrop |
{{CompatUnknown}} | {{CompatUnknown}} | {{CompatGeckoMobile(1.9.1)}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} |
oncanplay , oncanplaythrough , ondurationchange , onemptied , onended , onloadeddata , onloadedmetadata , onloadstart , onpause , onplay , onplaying , onprogress , onratechange , onseeked , onseeking , onstalled , ontimeupdate , onvolumechange , onwaiting |
{{CompatVersionUnknown}} | {{CompatUnknown}} | {{CompatGeckoMobile(1.9.1)}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatVersionUnknown}} |
onmouseenter , onmouseleave |
{{CompatVersionUnknown}} | {{CompatUnknown}} | {{CompatGeckoMobile(10)}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatVersionUnknown}} |
onsuspend |
{{CompatVersionUnknown}} | {{CompatUnknown}} | {{CompatGeckoMobile(1.9.2)}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatVersionUnknown}} |
ondragexit |
{{CompatNo}} | {{CompatUnknown}} | {{CompatNo}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatNo}} |
oncancel |
{{CompatVersionUnknown}} | {{CompatUnknown}} | {{CompatNo}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatVersionUnknown}} |
onclose |
{{CompatVersionUnknown}} | {{CompatUnknown}} | {{CompatNo}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatVersionUnknown}} |
oncuechange |
{{CompatVersionUnknown}} | {{CompatUnknown}} | {{CompatNo}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatVersionUnknown}} |
onmousewheel |
{{CompatVersionUnknown}} | {{CompatUnknown}} | {{CompatNo}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatVersionUnknown}} |
onsort |
{{CompatNo}} | {{CompatUnknown}} | {{CompatNo}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatNo}} |
onmozfullscreenchange , onmozfullscreenerror {{non-standard_inline}} |
{{CompatVersionUnknown}} {{property_prefix("-webkit")}} {{CompatVersionUnknown}} (unprefixed) |
{{CompatUnknown}} | {{CompatVersionUnknown}} | {{CompatNo}} | {{CompatNo}} | {{CompatNo}} | {{CompatNo}} | {{CompatVersionUnknown}} {{property_prefix("-webkit")}} {{CompatVersionUnknown}} (unprefixed) |
onpointerlockchange , onpointerlockerror |
{{CompatNo}} | {{CompatUnknown}} | {{CompatGeckoMobile(10)}}[1] | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatNo}} |
onpointercancel , onpointerdown , onpointerup , onpointermove , onpointerout , onpointerover , onpointerenter , onpointerleave |
{{CompatChrome(55.0)}} | {{CompatUnknown}} | {{CompatVersionUnknown}}[3] | {{CompatNo}} | 10 | {{CompatNo}} | {{CompatNo}} | {{CompatChrome(55.0)}} |
onselectionchange |
{{CompatNo}} | {{CompatUnknown}} | {{CompatGeckoMobile(43)}}[4] | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatNo}} |
ontouchend , ontouchcancel , ontouchmove , ontouchstart |
{{CompatVersionUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatVersionUnknown}} |
animationstart , animationend , animationcancel , animationiteration |
{{CompatVersionUnknown}} {{property_prefix("-webkit")}} {{CompatVersionUnknown}} (unprefixed) |
{{CompatUnknown}} | {{CompatGeckoMobile(51)}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatVersionUnknown}} {{property_prefix("-webkit")}} {{CompatVersionUnknown}} (unprefixed) |
ongotpointercapture , onlostpointercapture |
{{CompatChrome(57.0)}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatOperaMobile(44)}} | {{CompatUnknown}} | {{CompatChrome(57.0)}} |
onauxclick |
{{CompatVersionUnknown}} | {{CompatNo}} | {{CompatGeckoMobile(53)}} | {{CompatNo}} | {{CompatNo}} | {{CompatNo}} | {{CompatNo}} | {{CompatVersionUnknown}} |
onwheel |
{{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} |
[1] Dans Gecko c'est implémenté comme onmozpointerlockchange
, onmozpointerlockerror
.
[2] Dans Blink c'est implémenté comme onwebkitpointerlockchange
, onwebkitpointerlockerror
.
[3] C'est implémenté après la préférence dom.w3c_pointer_events.enabled
, par défaut à false
(faux).
[4] C'est implémenté après la préférence dom.select_events.enabled
par défaut à false
(faux), sauf sur Nightly.