An HTML form with two input fields and one submit button:
![]()
The <form> tag is supported in all major browsers.
The <form> tag is used to create an HTML form for user input.
The <form> element can contain one or more of the following form elements:
HTML5 has added two new attributes: autocomplete and novalidate, and removed the accept attribute.
In XHTML, the name attribute is deprecated. Use the global id attribute instead.
New : New in HTML5.
| Attribute | Value | Description |
|---|---|---|
| accept | MIME_type | Not supported in HTML5. Specifies the types of files that the server accepts (that can be submitted through a file upload) |
| accept-charset | character_set | Specifies the character encodings that are to be used for the form submission |
| action | URL | Specifies where to send the form-data when a form is submitted |
| autocompleteNew | on off |
Specifies whether a form should have autocomplete on or off |
| enctype | application/x-www-form-urlencoded multipart/form-data text/plain |
Specifies how the form-data should be encoded when submitting it to the server (only for method="post") |
| method | get post |
Specifies the HTTP method to use when sending form-data |
| name | text | Specifies the name of a form |
| novalidateNew | novalidate | Specifies that the form should not be validated when submitted |
| target | _blank _self _parent _top |
Specifies where to display the response that is received after submitting the form |
The <form> tag also supports the Global Attributes in HTML.
The <form> tag also supports the Event Attributes in HTML.
Form with
checkboxes
A form with two checkboxes, and a submit button.
Form with
radiobuttons
A form with two radio buttons, and a submit button.
HTML tutorial: HTML Forms and Input
HTML DOM reference: Form object
Your message has been sent to W3Schools.