accept-charset

HTML accept-charset Attribute (HTML接受字符集属性)

The HTML accept-charset attribute specifies the character encoding that must be used for the form submission. (HTML accept-charset属性指定表单提交必须使用的字符编码。)

You can use this attribute only on the <form> element.

The attribute value contains a list separated value of one or more encodings. The default value of the attribute is “UNKNOWN”, which indicates that the encoding equals the encoding of the document having the <form> element.

Syntax

Syntax (语法)

<form accept-charset="character_set"></form>

Example of the HTML accept-charset attribute:

<!DOCTYPE html>
<html>
 <head>
   <title>Title of the document</title>
   <style>
     input {
       display: block;
       margin-bottom: 10px;
     }
   </style>
 </head>
 <body>
   <form action="/form/submit" accept-charset="ISO-8859-1" method="post">
     <input type="text" name="name" placeholder="Enter your Name">
     <input type="text" name="surname" placeholder="Enter your Surname">
     <input type="number" name="age" placeholder="Enter your Age">
     <input type="submit" value="Send">
   </form>
 </body>
</html>


请遵守《互联网环境法规》文明发言,欢迎讨论问题
扫码反馈

扫一扫,反馈当前页面

咨询反馈
扫码关注
返回顶部