Skip to content
Related Articles
Get the best out of our app
GeeksforGeeks App
Open App
geeksforgeeks
Browser
Continue

Related Articles

HTML | <form> accept-charset Attribute

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

The HTML <form> accept-charset Attribute is used to define the character encoding and is used for form submission. The default value of the accept-charset attribute is “UNKNOWN” string which indicates the encoding equals to the encoding of the document containing the <form> element. 

Syntax: 

<form accept-charset = "character_set">

Attribute Value: The attribute value contains the list separated value of one or more encoding attributes. The common value of encoding attributes is UTF-8, ISO-8859-1. This attribute always associated with the form element only. 

Example: 

html




<!DOCTYPE html>
<html>
 
<head>
    <title>
      HTML form accept-charset attribute
  </title>
    <style>
        h1 {
            color: green;
        }
         
        body {
            text-align: center;
        }
    </style>
</head>
 
<body>
    <h1>GeeksforGeeks</h1>
    <h2>
      HTML &lt;form&gt; accept-charset Attribute
  </h2>
   
    <form action="#" accept-charset="UTF-8">
        First name:
        <input type="text" name="fname">
        <br> Last name:
        <input type="text" name="lname">
        <br>
        <input type="submit" value="Submit">
    </form>
</body>
 
</html>

Output:

  

Supported Browsers: The browsers supported by HTML <form> accept-charset Attribute are listed below:

  • Google Chrome
  • Edge 12 and above
  • Internet Explorer
  • Firefox
  • Apple Safari
  • Opera

My Personal Notes arrow_drop_up
Last Updated : 22 Jul, 2022
Like Article
Save Article
Similar Reads
Related Tutorials