HTML 标签:form
Form,通常用于方便提交用户输入的数据。
与 input、select 和 textarea 等元素一起使用,以创建表单控件。
可选属性
| 属性 | 描述 | 可能的值 |
|---|---|---|
action |
提交的表单数据应发送到的地址。 | URL。 |
method |
提交表单数据应发送的 HTTP 方法。 |
|
enctype |
用于编码表单数据的 MIME 类型。 |
|
accept-charset |
提交数据的字符编码。 | 字符编码,例如 utf-8,或用空格分隔的多个字符编码。 |
autocomplete |
设置表单中控件的默认自动填充。 |
|
name |
表单的唯一名称,当页面包含多个表单时使用。 | 文本。 |
novalidate |
指示在提交表单之前不应对其进行验证。 | 无。 |
target |
提交的表单的目标 URL 应打开的浏览上下文。 |
|
| 全局属性 | ||
示例
<form action="someKindOfProcessingScript.php" method="post">
<label for="housenumber">House number</label>
<input name="housenumber" id="housenumber">
<label for="street">Street</label>
<input name="street" id="street">
<input type="submit">
</form>
