--- title: GlobalEventHandlers slug: Web/API/GlobalEventHandlers tags: - API - DOM - HTML DOM translation_of: Web/API/GlobalEventHandlers ---
{{ ApiRef("HTML DOM") }}

The GlobalEventHandlers interface describes the event handlers common to several interfaces like {{domxref("HTMLElement")}}, {{domxref("Document")}}, {{domxref("Window")}}, or {{domxref("WorkerGlobalScope")}} for Web Workers. Each of these interfaces can implement more event handlers.

GlobalEventHandlers is a raw interface and no object of this type can be created.

Properties

The events properties, of the form onXYZ, are defined on the {{domxref("GlobalEventHandlers")}}, and implemented by {{domxref("HTMLElement")}}, {{domxref("Document")}}, {{domxref("Window")}}, and {{domxref("WorkerGlobalScope")}} for Web Workers.

{{domxref("GlobalEventHandlers.onabort")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("abort")}} event is raised.
{{domxref("GlobalEventHandlers.onblur")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("blur")}} event is raised.
{{domxref("GlobalEventHandlers.onerror")}}
Is an {{domxref("OnErrorEventHandler")}} representing the code to be called when the {{event("error")}} event is raised.
{{domxref("GlobalEventHandlers.onfocus")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("focus")}} event is raised.
{{domxref("GlobalEventHandlers.oncancel")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("cancel")}} event is raised.
{{domxref("GlobalEventHandlers.oncanplay")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("canplay")}} event is raised.
{{domxref("GlobalEventHandlers.oncanplaythrough")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("canplaythrough")}} event is raised.
{{domxref("GlobalEventHandlers.onchange")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("change")}} event is raised.
{{domxref("GlobalEventHandlers.onclick")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("click")}} event is raised.
{{domxref("GlobalEventHandlers.onclose")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("close")}} event is raised.
{{domxref("GlobalEventHandlers.oncontextmenu")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("contextmenu")}} event is raised.
{{domxref("GlobalEventHandlers.oncuechange")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("cuechange")}} event is raised.
{{domxref("GlobalEventHandlers.ondblclick")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("dblclick")}} event is raised.
{{domxref("GlobalEventHandlers.ondrag")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("drag")}} event is raised.
{{domxref("GlobalEventHandlers.ondragend")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("dragend")}} event is raised.
{{domxref("GlobalEventHandlers.ondragenter")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("dragenter")}} event is raised.
{{domxref("GlobalEventHandlers.ondragexit")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("dragexit")}} event is raised.
{{domxref("GlobalEventHandlers.ondragleave")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("dragleave")}} event is raised.
{{domxref("GlobalEventHandlers.ondragover")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("dragover")}} event is raised.
{{domxref("GlobalEventHandlers.ondragstart")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("dragstart")}} event is raised.
{{domxref("GlobalEventHandlers.ondrop")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("drop")}} event is raised.
{{domxref("GlobalEventHandlers.ondurationchange")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("durationchange")}} event is raised.
{{domxref("GlobalEventHandlers.onemptied")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("emptied")}} event is raised.
{{domxref("GlobalEventHandlers.onended")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("ended")}} event is raised.
{{domxref("GlobalEventHandlers.oninput")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("input")}} event is raised.
{{domxref("GlobalEventHandlers.oninvalid")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("invalid")}} event is raised.
{{domxref("GlobalEventHandlers.onkeydown")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("keydown")}} event is raised.
{{domxref("GlobalEventHandlers.onkeypress")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("keypress")}} event is raised.
{{domxref("GlobalEventHandlers.onkeyup")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("keyup")}} event is raised.
{{domxref("GlobalEventHandlers.onload")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("load")}} event is raised.
{{domxref("GlobalEventHandlers.onloadeddata")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("loadeddata")}} event is raised.
{{domxref("GlobalEventHandlers.onloadedmetadata")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("loadedmetadata")}} event is raised.
{{domxref("GlobalEventHandlers.onloadstart")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("loadstart")}} event is raised.
{{domxref("GlobalEventHandlers.onmousedown")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("mousedown")}} event is raised.
{{domxref("GlobalEventHandlers.onmouseenter")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("mouseenter")}} event is raised.
{{domxref("GlobalEventHandlers.onmouseleave")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("mouseleave")}} event is raised.
{{domxref("GlobalEventHandlers.onmousemove")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("mousemove")}} event is raised.
{{domxref("GlobalEventHandlers.onmouseout")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("mouseout")}} event is raised.
{{domxref("GlobalEventHandlers.onmouseover")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("mouseover")}} event is raised.
{{domxref("GlobalEventHandlers.onmouseup")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("mouseup")}} event is raised.
{{domxref("GlobalEventHandlers.onmousewheel")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("mousewheel")}} event is raised.
{{domxref("GlobalEventHandler.onmozfullscreenchange")}} {{non-standard_inline}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("fullscreenchange")}} event is raised.
{{domxref("GlobalEventHandler.onmozfullscreenerror")}} {{non-standard_inline}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("fullscreenerror")}} event is raised.
{{domxref("GlobalEventHandlers.onpause")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("pause")}} event is raised.
{{domxref("GlobalEventHandlers.onplay")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("play")}} event is raised.
{{domxref("GlobalEventHandlers.onplaying")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("playing")}} event is raised.
{{domxref("GlobalEventHandlers.onpointerdown")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("pointerdown")}} event is raised.
{{domxref("GlobalEventHandlers.onpointermove")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("pointermove")}} event is raised.
{{domxref("GlobalEventHandlers.onpointerup")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("pointerup")}} event is raised.
{{domxref("GlobalEventHandlers.onpointercancel")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("pointercancel")}} event is raised.
{{domxref("GlobalEventHandlers.onpointerover")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("pointerover")}} event is raised.
{{domxref("GlobalEventHandlers.onpointerout")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("pointerout")}} event is raised.
{{domxref("GlobalEventHandlers.onpointerenter")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("pointerevent")}} event is raised.
{{domxref("GlobalEventHandlers.onpointerleave")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("pointerleave")}} event is raised.
{{domxref("GlobalEventHandlers.onpointerlockchange")}} {{experimental_inline}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("pointerlockchange")}} event is raised.
{{domxref("GlobalEventHandlers.onpointerlockerror")}} {{experimental_inline}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("pointerlockerror")}} event is raised.
{{domxref("GlobalEventHandlers.onprogress")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("progress")}} event is raised.
{{domxref("GlobalEventHandlers.onratechange")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("ratechange")}} event is raised.
{{domxref("GlobalEventHandlers.onreset")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("reset")}} event is raised.
{{domxref("GlobalEventHandlers.onscroll")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("scroll")}} event is raised.
{{domxref("GlobalEventHandlers.onseeked")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("seeked")}} event is raised.
{{domxref("GlobalEventHandlers.onseeking")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("seeking")}} event is raised.
{{domxref("GlobalEventHandlers.onselect")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("select")}} event is raised.
{{domxref("GlobalEventHandlers.onshow")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("show")}} event is raised.
{{domxref("GlobalEventHandlers.onsort")}} {{experimental_inline}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("sort")}} event is raised.
{{domxref("GlobalEventHandlers.onstalled")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("stalled")}} event is raised.
{{domxref("GlobalEventHandlers.onsubmit")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("submit")}} event is raised.
{{domxref("GlobalEventHandlers.onsuspend")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("suspend")}} event is raised.
{{domxref("GlobalEventHandlers.ontimeupdate")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("timeupdate")}} event is raised.
{{domxref("GlobalEventHandlers.onvolumechange")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("volumechange")}} event is raised.
{{domxref("GlobalEventHandlers.onwaiting")}}
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("waiting")}} event is raised.

Methods

This interface defines no method.

Specifications

Specification Status Comment
{{SpecName('Pointer Lock', '#extensions-to-the-document-interface', 'Extension of Document')}} {{Spec2('Pointer Lock')}} Adds onpointerlockchange and onpointerlockerror on {{domxref("Document")}}. It is experimentally implemented on GlobalEventHandlers.
{{SpecName('HTML WHATWG', '#globaleventhandlers', 'GlobalEventHandlers')}} {{Spec2('HTML WHATWG')}} No change since the latest snapshot, {{SpecName("HTML5.1")}}.
{{SpecName('HTML5.1', '#globaleventhandlers', 'GlobalEventHandlers')}} {{Spec2('HTML5.1')}} Snapshot of {{SpecName("HTML WHATWG")}}. Added onsort since the {{SpecName("HTML 5")}} snapshot.
{{SpecName("HTML5 W3C", "#globaleventhandlers", "GlobalEventHandlers")}} {{Spec2('HTML5 W3C')}} Snapshot of {{SpecName("HTML WHATWG")}}. Creation of GlobalEventHandlers (properties where on the target before it).

Совместимость с браузерами

{{Compat("api.GlobalEventHandlers")}}

См. также