accept

Jump to: navigation, search

accept


De Facto Standard

Summary

Sets or retrieves a comma-separated list of content types.


Applies to HTMLInputElement

Examples

Indicates that audio files are accepted.

HTML

<input type="file" accept="audio/*" />

Indicates that video files are accepted.

HTML

<input type="file" accept="video/*" />

Indicates that image files are accepted.

HTML

<input type="file" accept="image/*" />

Indicates that both PNG and GIF file formats are accepted.

HTML

<input type="file" accept="image/png, image/gif" />

Usage

Value must be a MIME type in the format type/subtype. Multiple values are valid if comma-separated.

Notes

Remarks

The information from the list can be used to filter out nonconforming files when prompting a user to select files to be sent to the server using the <INPUT> element with type="file". Examples of content types include "text/html", "image/png", "image/gif", "video/mpeg", "audio/basic", "text/tcl", "text/javascript", and "text/vbscript". For the current list of registered MIME types, see MIME Media Types. There is no functionality implemented for this property unless defined by the author. accept was introduced in Microsoft Internet Explorer 6


Compatibility

Desktop

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic Support Beta
1
5
3
0.8

Mobile

Feature Android BlackBerry Chrome for mobile Firefox Mobile (Gecko) IE Mobile Opera Mobile Opera Mini Safari Mobile
Basic Support 1
6
Beta
14
4
3
Beta
3

See also

Related articles

HTML




  • accept






















External resources

Related pages (MSDN)

  • input

This article contains content originally from external sources.

Portions of this content come from the Microsoft Developer Network: [Windows Internet Explorer API reference Article]