coderef

input (event)Baseline · Widely available

The input event fires when a form control changes or an element with the contenteditable attribute changes.

Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Jan 15, 2020. Widely available since Jul 15, 2022.

Browser support

DesktopChrome
1+Supportedsince Dec 11, 2008
Current: 155
Edge
12–18Not supported
79+Supportedsince Jan 15, 2020
Current: 154
Firefox
1–5Not supported
6+Supportedsince Aug 16, 2011
Current: 157
Safari
1–3Not supported
3.1+Supportedsince Mar 18, 2008
Current: 27
MobileChrome Android
18+Supportedsince Jun 27, 2012
Current: 155
Firefox Android
4–5Not supported
6+Supportedsince Aug 16, 2011
Current: 157
Safari iOS
1–1Not supported
2+Supportedsince Jul 11, 2008
Current: 27

How to use

This feature is Baseline widely available — use it freely, no fallback needed.

Example

Full syntax and examples are on MDN: beforeinput event.

Feature detection

JS · check before using
if ("InputEvent" in globalThis) {
  // InputEvent is available
} else {
  // load a polyfill or use a fallback
}

Sub-features

Support for each part of the feature (10). The overall table above shows when the whole feature works.

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
Element.beforeinput_event60798710.1608710.3
Element.input_event17963.11862
InputEvent60793110.1603110.3
InputEvent.InputEvent60793110.1603110.3
InputEvent.data60796710.1606710.3
InputEvent.dataTransfer60796710.1606710.3
InputEvent.getTargetRanges60798710.1608710.3
InputEvent.inputType60796610.1606610.3
InputEvent.inputType.insertFromPasteAsQuotation✕✕67✕✕67✕
InputEvent.isComposing607931✕6031✕