DOM Events
A curated reference of 109 common DOM events drawn from the MDN Web Docs Event reference and the WHATWG/W3C specifications. Each record captures the event name, its category (mouse, keyboard, touch, form, window, focus, drag, pointer, media, clipboard, animation, device, or dom), the Web API interface that represents the event object, whether the event bubbles through the DOM, whether it is cancelable (i.e. its default action can be prevented via preventDefault()), and a concise description of when the event fires.
Quick fetch
Stable URL. CORS-enabled. No auth.
curl https://staticdata.dev/v1/dom-events.json
Or use as a typed import:
import { domEvents } from "https://staticdata.dev/v1/dom-events.ts"
Formats
- JSON 26.0 KB
/v1/dom-events.json
min: 21.5 KB · /v1/dom-events.min.json
- CSV 13.5 KB
/v1/dom-events.csv
- TypeScript 26.1 KB
/v1/dom-events.ts
export const domEvents
type DomEvent = (typeof domEvents)[number]
Schema
Each record in the dataset has the following shape.
| Field | Type | Description | Example |
|---|---|---|---|
| name | string | The event type string passed to addEventListener | click |
| category | string | Functional category of the event | mouse |
| interface | string | Web API interface representing the event object | MouseEvent |
| bubbles | boolean | Whether the event bubbles up through the DOM tree | true |
| cancelable | boolean | Whether the default action can be prevented via preventDefault() | true |
| description | string | Short description of when and why the event fires | Fired when a pointing device button is pressed and released on a single element. |
Preview
First 10 records.
| name | category | interface | bubbles | cancelable | description |
|---|---|---|---|---|---|
| abort | resource | Event | false | false | Fired when a resource load has been aborted (e.g. the user cancelled it). |
| animationcancel | animation | AnimationEvent | true | false | Fired when a CSS animation unexpectedly aborts, i.e. any time it stops running without sending an animationend event. |
| animationend | animation | AnimationEvent | true | false | Fired when a CSS animation has completed one cycle. |
| animationiteration | animation | AnimationEvent | true | false | Fired when an iteration of a CSS animation ends and a new iteration begins. |
| animationstart | animation | AnimationEvent | true | false | Fired when a CSS animation has started. |
| auxclick | mouse | PointerEvent | true | true | Fired when a non-primary pointer button (e.g. middle or right mouse button) has been pressed and released on an element. |
| beforeinput | form | InputEvent | true | true | Fired when the value of an input, select, or textarea element is about to be modified. |
| beforeunload | window | BeforeUnloadEvent | false | true | Fired when the window, the document and its resources are about to be unloaded. The document is still visible and the event is still cancelable. |
| blur | focus | FocusEvent | false | false | Fired when an element has lost focus. Unlike focusout, this event does not bubble. |
| canplay | media | Event | false | false | Fired when the browser can start playing the media, though it estimates not enough data has been loaded to play through to the end without buffering. |
Fetch examples
Drop-in snippets in five languages.
curl -sSL https://staticdata.dev/v1/dom-events.json | jq '.[0]' import type { DomEvent } from "https://staticdata.dev/v1/dom-events.ts";
const res = await fetch("https://staticdata.dev/v1/dom-events.min.json");
if (!res.ok) throw new Error(`Fetch failed: ${res.status}`);
const domEvents: DomEvent[] = await res.json();
console.log(domEvents[0]); import urllib.request, json
with urllib.request.urlopen("https://staticdata.dev/v1/dom-events.min.json") as r:
domEvents = json.load(r)
print(domEvents[0]) package main
import (
"encoding/json"
"fmt"
"net/http"
)
func main() {
resp, err := http.Get("https://staticdata.dev/v1/dom-events.min.json")
if err != nil { panic(err) }
defer resp.Body.Close()
var data []map[string]any
if err := json.NewDecoder(resp.Body).Decode(&data); err != nil {
panic(err)
}
fmt.Println(data[0])
} use serde_json::Value;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let body = ureq::get("https://staticdata.dev/v1/dom-events.min.json").call()?.into_string()?;
let data: Vec<Value> = serde_json::from_str(&body)?;
println!("{:?}", data.first());
Ok(())
} Sources and methodology
This dataset covers 109 widely-used DOM events across all major event categories: mouse (click, dblclick, mousemove, mouseenter, mouseleave, etc.), keyboard (keydown, keyup, keypress), pointer (pointerdown, pointermove, pointerup, pointercancel), touch (touchstart, touchmove, touchend, touchcancel), form (input, change, submit, reset, focus, blur), drag (dragstart, drag, dragend, dragenter, dragleave, dragover, drop), media (play, pause, ended, timeupdate, volumechange, etc.), clipboard (copy, cut, paste), animation and transition (animationstart, transitionend, etc.), and window/document-level events (scroll, resize, load, DOMContentLoaded, visibilitychange, hashchange, popstate, storage, online, offline, beforeunload).
The bubbles flag indicates whether the event propagates upward through the DOM tree during the bubble phase; events that do not bubble (such as focus, blur, mouseenter, and mouseleave) can only be listened to on the target element itself or via the capture phase. The cancelable flag indicates whether calling event.preventDefault() can suppress the browser’s default behaviour for that event; non-cancelable events (such as scroll, load, and resize) will proceed with their default action regardless. The interface column names the specific Web API interface class whose instances are passed to event handlers, giving access to event-specific properties (for example, MouseEvent exposes clientX/clientY, while KeyboardEvent exposes key and code).
Events marked as deprecated (keypress, unload) are included for completeness and to document legacy codebases; MDN recommends replacing them with their modern equivalents (keydown/keyup and pagehide/visibilitychange respectively). Media events apply to HTMLVideoElement and HTMLAudioElement. Where an event’s flags depend on the target (e.g. scroll bubbles at the Document but not at elements; wheel and beforeinput are cancelable only in some cases) the most common case is recorded; bubbles, cancelable and interface values were cross-checked against the @webref/events extract of the specifications. Category values used in this dataset are: animation, clipboard, device, dom, drag, focus, form, keyboard, media, mouse, pointer, resource, touch, and window.
Versioning
URLs under /v1/ are stable: field names and types will not change in a way
that breaks consumers. Values can be corrected or records added when the upstream source
changes; schema-incompatible updates ship under a new version path. See the
dom-events changelog for this dataset's history.
Related datasets
More Web datasets
- aria-attributes
- aria-roles
- character-encodings
- csp-directives
- credit-card-types
- dns-record-types
- emoji
- emoji-shortcodes
- html-entities
- html-attributes
- input-types
- http-auth-schemes
- http-cache-directives
- http-content-codings
- http-headers
- http-status-codes
- http-versions
- iframe-sandbox-tokens
- ip-protocol-numbers
- keyboard-event-codes
- link-relations
- media-type-suffixes
- mime-types
- oauth-grant-types
- ports
- referrer-policies
- ip-special-blocks
- svg-elements
- tcp-flags
- tlds
- tls-cipher-suites
- tls-versions
- uri-schemes
- well-known-uris