最后更新:2026-09-12
<form>(表单)元素是收集和提交用户数据的容器。它包裹各种表单控件(<input>、<select>、<textarea> 等),通过 action 指定提交地址、method 指定提交方式。
<form>
<input>
<select>
<textarea>
action
method
</form>
<form action="提交地址" method="post"> 表单控件 <input type="submit" value="提交"> </form>
该元素支持全局属性及以下专有属性:
默认值: 当前页 URL
当前页 URL
get
post
name
autocomplete
on
off
novalidate
target
默认值: _self
_self
编辑下方代码,在 playground 中查看实时效果:
<label>
Web-Tutorial 技术团队
由多位开发者共同维护的编程教程平台。每篇教程由对应领域的开发者编写和审核,确保内容准确可靠。如发现任何问题,欢迎向我们反馈。
关于我们