🔸event.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
❺ 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