Skip to content

Latest commit

 

History

History
42 lines (30 loc) · 1.13 KB

File metadata and controls

42 lines (30 loc) · 1.13 KB

HTML enctype 属性

定义和用法

enctype 属性指定表单数据在提交到服务器时应如何编码。

注意: 只有在 method="post" 时才能使用 enctype 属性。

适用于

enctype 属性可用于以下元素:

元素 Element 属性 Attribute
<form> enctype

示例

发送编码为“multipart/form-data”的表单数据:

<form action="/action_page_binary.asp" method="post" enctype="multipart/form-data">
  First name: <input type="text" name="fname"><br>
  Last name: <input type="text" name="lname"><br>
  <input type="submit" value="Submit">
</form>

浏览器支持

属性 Attribute chrome edge firefox safari opera
enctype Yes Yes Yes Yes Yes