🔸event.type

browserevent ⟩ .type

the string that specifies what kind of event occurred, also called "event name".

device-dependent input events

  • mouse: “mousedown”, “mousemove”, “mouseup

  • mobile devices: “touchstart”, “touchmove”, “touchend

  • keyboard: “keydown”, “keyup

device-independent input events

  • click”: a link/button/other element has been activated.

  • input”: (alternative to “keydown”) supports keyboard input, cut-and-paste, ideographic scripts.

  • pointerdown”, “pointermove”, “pointerup”: (alternatives to mouse/touch events) work for mouse, touch screen, pen/stylus.

UI events

  • "focus", "change", "submit" ...

state-change events

  • "load" (on Window)

  • "DOMContentLoaded" (on Document)

  • "online", "offline" (on Window): network connectivity

  • "popstate" (on Window): browser’s Back button clicked.

API-specific events

  • HTML <video>/<audio> elements: “waiting”, “playing”, “seeking”, “volumechange” ...

  • Generally speaking, web platform APIs that are asynchronous and were developed before Promises were added to JavaScript are event-based and define API-specific events.

Last updated