Definition and Usage The accept attribute specifies the different content types the form application will process correctly. This attribut...
Definition and Usage
The accept attribute specifies the different content types the form application will process correctly.
This attribute is only used if the type attribute of the input element is set to "file".
This attribute is poorly supported in all major browsers. It is recommended to use server side validation on file uploading.
Syntax
<input accept="content_type" /> |
Syntax Example
<input accept="image/gif" /> |
Attribute Values
Value | Description |
content_type | A comma-separated list of content types accepted by the form processing server.Possible values: |
Browser Support
Note: This attribute is not well supported in any of the major browsers.
Example
<form action="demo_input_example.asp">
<input type="file" accept="image/gif"
id="pic" name="pic" />
</form> |