How many types of events are there in javascript?

Event typeDescriptionDocumentation
Animation

Events related to the Web Animation API.

Used to respond to changes in animation status (e.g. when an animation starts or ends).

Animation events fired on Document, Window, HTMLElement.
Asynchronous data fetching

Events related to the fetching data.

Events fired on AbortSignal, XMLHttpRequest, FileReader.
Clipboard

Events related to the Clipboard API.

Used to notify when content is cut, copied, or pasted.

Events fired on Document, Element, Window.
Composition

Events related to composition; entering text "indirectly" (rather than using normal keyboard presses).

For example, text entered via a speech to text engine, or using special key combinations that modify keyboard presses to represent new characters in another language.

Events fired on Element.
CSS transition

Events related to CSS Transitions.

Provides notification events when CSS transitions start, stop, are cancelled, etc.

Events fired on Document, HTMLElement, Window.
Database

Events related to database operations: opening, closing, transactions, errors, etc.

Events fired on IDBDatabase, IDBOpenDBRequest, IDBRequest, IDBTransaction.
DOM mutation

Events related to modifications to the Document Object Model (DOM) hierarchy and nodes.

Warning: Mutation Events are deprecated. Mutation Observers should be used instead.

Drag'n'drop, Wheel

Events related to using the HTML Drag and Drop API and wheel events.

Drag and Wheel events are derived from mouse events. While they are fired when using mouse wheel or drag/drop, they may also be used with other appropriate hardware.

Drag events fired on Document

Wheel events fired on Document and Element

Focus

Events related to elements gaining and losing focus.

Events fired on Element, Window.
Form

Events related to forms being constructed, reset and submitted.

Events fired on HTMLFormElement.
Fullscreen

Events related to the Fullscreen API.

Used to notify when the transitioning between full screen and windowed modes, and also of errors occurring during this transition.

Events fired on Document, Element.
Gamepad

Events related to the Gamepad API.

Events fired on Window.
Gestures

Touch events are recommended for implementing gestures.

Events fired on Document, Element.

In addition there are a number of non-standard gesture events:

  • Non-standard WebKit specific events on Element: gesturestart event, gesturechange event, gestureend event.
  • Non-standard IE specific events on Element: MSGestureStart, MSGestureChange, MSGestureEnd, MSGestureHold, MSGestureTap.
  • Mouse gesture events for Firefox Addons
History

Events related to the History API.

Events fired on Window.
HTML element content display management

Events related to changing the state of a display or textual element.

Events fired on HTMLDetailsElement, HTMLDialogElement, HTMLSlotElement.
Inputs

Events related to HTML input elements e.g. ,