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: 155Edge
12–18Not supported
79+Supportedsince Jan 15, 2020
Current: 154Firefox
1–5Not supported
6+Supportedsince Aug 16, 2011
Current: 157Safari
1–3Not supported
3.1+Supportedsince Mar 18, 2008
Current: 27MobileChrome Android
18+Supportedsince Jun 27, 2012
Current: 155Firefox Android
4–5Not supported
6+Supportedsince Aug 16, 2011
Current: 157Safari iOS
1–1Not supported
2+Supportedsince Jul 11, 2008
Current: 27How 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
}Documentation (MDN)
Specification
Usage share
Sub-features
Support for each part of the feature (10). The overall table above shows when the whole feature works.
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| Element.beforeinput_event | 60 | 79 | 87 | 10.1 | 60 | 87 | 10.3 |
| Element.input_event | 1 | 79 | 6 | 3.1 | 18 | 6 | 2 |
| InputEvent | 60 | 79 | 31 | 10.1 | 60 | 31 | 10.3 |
| InputEvent.InputEvent | 60 | 79 | 31 | 10.1 | 60 | 31 | 10.3 |
| InputEvent.data | 60 | 79 | 67 | 10.1 | 60 | 67 | 10.3 |
| InputEvent.dataTransfer | 60 | 79 | 67 | 10.1 | 60 | 67 | 10.3 |
| InputEvent.getTargetRanges | 60 | 79 | 87 | 10.1 | 60 | 87 | 10.3 |
| InputEvent.inputType | 60 | 79 | 66 | 10.1 | 60 | 66 | 10.3 |
| InputEvent.inputType.insertFromPasteAsQuotation | ✕ | ✕ | 67 | ✕ | ✕ | 67 | ✕ |
| InputEvent.isComposing | 60 | 79 | 31 | ✕ | 60 | 31 | ✕ |