Last updated: 2026-09-12
The <form> element is the container for collecting and submitting user data. It wraps form controls (<input>, <select>, <textarea>…), with action for the submit URL and method for the HTTP method.
<form>
<input>
<select>
<textarea>
action
method
</form>
<form action="submit-url" method="post"> Form controls <input type="submit" value="Submit"> </form>
This element supports the global attributes plus the following:
Default: 当前页 URL
当前页 URL
get
post
name
autocomplete
on
off
novalidate
target
Default: _self
_self
Edit the code below and see the live result in the playground:
Web-Tutorial Tech Team
A team of developers maintaining programming tutorials. Each tutorial is written and reviewed by developers with expertise in that field. We work to keep our content accurate and reliable — if you spot an issue, please let us know.
About Us