Skip to: content, navigation

by Ian Lloyd

accept (HTML attribute)

Browser support full matrix
IE5.5+ FF1+ Saf1.3+ Op9.2+
Buggy Buggy Buggy Buggy
Spec
Depr. Version
No HTML 2
accept="MIME type"

Example

Here, the accept attribute is used in a file upload input:

<input type="file" name="picture" id="picture"
    accept="image/jpeg"/>

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.

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

IE5.5Buggy
6.0Buggy
7.0Buggy
Firefox1.0Buggy
1.5Buggy
2.0Buggy
Safari1.3Buggy
2.0Buggy
3.0Buggy
Opera9.2Buggy

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.

Related Products

The Principles of Beautiful Web Design

Best Seller!

You don’t need to go to Art School to design great looking web sites!

Book Cover: The Principles of Beautiful Web Design

Download the FREE sample chapters