Extension & Emerging Attributes

capture

Build a form with the HTML form generator

Hints that a file input should offer a media-capture workflow when accept requests appropriate media. user requests a user-facing device and environment requests an outward-facing one; the browser may still offer a file picker. Requires device support and consent, and does not validate uploaded files.

Formal Syntax & Structure

html syntaxhtml
capture="user" | capture="environment"

Parameters & Attributes

NameTypeDescription
captureenumeratedPreferred capture direction; user or environment.

Working Example

Example Snippethtml
<label>  Photo  <input type="file" accept="image/*" capture="environment"></label>

Browser Compatibility

Minimum supported versions across modern rendering engines

Chrome
Not supported in checked snapshot
No
Firefox
Not supported in checked snapshot
No
Safari
Not supported in checked snapshot
No
Checked desktop BCD snapshot: capture on file input; desktop only. Versions denote the recorded start of support (≤ means at least that early), not a guarantee of all behavior. Unresolved mirror and preview rows omitted. The source lists Android Chrome 25, Android Firefox 79 and iOS Safari 10; camera UI and permissions are not guaranteed.
HTML Media Capture
HTML Reference