Extension & Emerging Attributes
webkitdirectory
Boolean file-input attribute requesting directory selection. Selected files can expose relative paths through webkitRelativePath; the historical prefix remains in the API. Validate file paths and contents on the server and provide a regular file-selection fallback for unsupported devices.
Formal Syntax & Structure
html syntaxhtml
<input type="file" webkitdirectory>Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| webkitdirectory | boolean | Presence requests directory selection. |
Working Example
Example Snippethtml
<label> Choose folder <input type="file" webkitdirectory multiple></label>Browser Compatibility
Minimum supported versions across modern rendering engines
Chrome
7
Yes
Edge
13
Yes
Firefox
50
Yes
Safari
11.1
Yes
Checked desktop BCD snapshot: webkitdirectory on input; desktop directory selection. Versions denote the recorded start of support (≤ means at least that early), not a guarantee of all behavior. Unresolved mirror and preview rows omitted. Mobile picker behavior is separately versioned.