HTML media captureLimited availability
The capture HTML attribute for <input type="file"> elements allows the user to capture media using the device's camera or microphone.
Not yet supported in all major browsers — check the table and provide a fallback.
Browser support
DesktopChrome
✕Not supportedup to 155
Current: 155Edge
✕Not supportedup to 154
Current: 154Firefox
✕Not supportedup to 157
Current: 157Safari
✕Not supportedup to 27
Current: 27MobileChrome Android
18–18Not supported
25+Supportedsince Feb 27, 2013
Current: 155Firefox Android
4–68Not supported
79+Supportedsince Jul 28, 2020
Current: 157Safari iOS
1–9.3Not supported
10+Supportedsince Sep 13, 2016
Current: 27How to use
Not supported in Chrome, Edge, Firefox, Safari. Use feature detection below and provide a fallback (or a polyfill) for those browsers.
Example
Full syntax and examples are on MDN: capture.
Feature detection
JS · check before using
if ("HTMLInputElement" in globalThis && "capture" in HTMLInputElement.prototype) {
// HTMLInputElement.capture is available
}Specification
Usage share
Sub-features
Support for each part of the feature (2). The overall table above shows when the whole feature works.
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| HTMLInputElement.capture | ✕ | ✕ | ✕ | ✕ | 25 | 79 | 10 |
| input.capture | ✕ | ✕ | ✕ | ✕ | 25 | 79 | 10 |