accept (HTML attribute)
| Depr. | Version |
|---|---|
| No | HTML 2 |
| IE5.5+ | FF1+ | SA1.3+ | OP9.2+ |
|---|---|---|---|
| Buggy | Buggy | Buggy | Buggy |
Syntax
Description
The
accept attribute is used to filter the types of
files that can be submitted through a file upload input. Browser support
for this attribute is inconsistent, however, and the job of validating
file uploads is best left to the server.
Example
Here, the
accept attribute is used in a file upload
input:
<input type="file" name="picture" id="picture"
accept="image/jpeg"/>
Value
The attribute takes a MIME type in
the format type/subtype—for example, "text/html",
"image/x-rgb", or
"application/java". Multiple values can be applied, but
they must be comma-separated.
Compatibility
| Internet Explorer | Firefox | Safari | Opera | |||||||
|---|---|---|---|---|---|---|---|---|---|---|
| 5.5 | 6.0 | 7.0 | 1.0 | 1.5 | 2.0 | 1.3 | 2.0 | 3.0 | 9.2 | 9.5 |
| Buggy | Buggy | Buggy | Buggy | Buggy | Buggy | Buggy | Buggy | Buggy | Buggy | Buggy |
This element is poorly supported and should not be relied upon.
User-contributed notes
There are no comments yet.
Add a note
To post a note on this topic, please log in with your SitePoint username and password. If you don't have an account yet, you can create a new account for free.