Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML form accept Attribute

HTML
The accept attribute

HTML form Tag Reference HTML Tag

Example

Specifying that in a file upload, the server only accepts gif and jpeg files:

  First name:

  Last name:

  Your image:

 

Try it »


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

**Note:** Almost no major browser supports the accept attribute.


Definition and Usage

In HTML5, the

accept attribute is not supported.

The accept attribute specifies the types of files accepted by the server that can be submitted through file upload.

**Tip:** Avoid using this attribute as a validation tool. File uploads should be validated on the server side.


Syntax

IANA MIME types, for a complete list of standard MIME types.


HTML form Tag Reference HTML tag