accept (HTML attribute)

Spec
Depr. Version
No HTML 2
Browser support (more…)
IE5.5+ FF1+ SA1.3+ OP9.2+ CH2+
Buggy Buggy Buggy Buggy Buggy

Syntax

accept="MIME type"

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 Chrome
5.5 6.0 7.0 8.0 1.0 1.5 2.0 1.3 2.0 3.1 4.0 9.2 9.5 10.0 2.0
Buggy Buggy Buggy Buggy 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

Related Products