HTML accept-charset Attribute specifies the character encoding that should be used for the submission of the form data. If character encoding is not defined then the document encoding will be used for the form data as well.
Table of Contents
Syntax of HTML accept-charset Attribute
The Syntax of HTML accept-charset Attribute is shown below.
<form accept-charset="character_set">
</form>
Usage of HTML accept-charset Attribute
HTML accept-charset Attribute is used to define the character encoding type for the form data. HTML accept-charset Attribute is used inside the form tag.
Used For
HTML accept-charset Attribute is used for following tags.
Tag Name |
---|
HTML form Tag |
Example of HTML accept-charset Attribute
Simple example of HTML accept-charset Attribute is given below.
<form accept-charset = "UTF-8">
</form>
In above example we have used UTF-8 character encoding for the form data.
Values of HTML accept-charset Attribute
Common values used with HTML accept-charset Attribute are.
Value | Description |
---|---|
UTF-8 | Character Encoding for Unicode. |
ISO-8859-1 | Character Encoding for the Latin alphabet. |
Browser Support for HTML accept-charset Attribute
HTML accept-charset Attribute is supported by following major browsers.
Browser Name | Version |
---|---|
Chrome | All |
Firefox | All |
Opera | All |
IE / Edge | All |
Safari | All |