New! My 44-page ebook "CSS in 44 minutes" is out! 😃
# form
Defines an interactive form with controls.
Example: Copy
action
Defines which URL the form's information is sent to when submitted.
"/contact"
You can use a relative URL.
"https://htmlreference.io/contact"
You can use an absolute URL.
method
Defines the HTTP method used when submitting the form.
"post"
The form information is sent to the server as part of the request body.
"get"
The form information is sent to the server as part URL parameters: /contact?first_name=Alex&last_name=Smith
.
name
The form's name when sent to the server. Useful when multiple forms are present on the same web page.
"sign_up_form"
The name value must be unique within the context of the whole web page.
It can only contain alphanumeric characters a-z
A-Z
0-9
and some special characters like -
_
… but no space.
autocomplete
Determines if the browser can autocomplete all the form's controls.
"off"
The browser will disable autocomplete functions. This can however be overriden for each control individually.
"on"
The browser will enable autocomplete functions. This can however be overriden for each control individually.
Try pressing "down" in this input. It will show previously entered email addresses.
target
Defines in which tab or window the clicked link will show up.
"_blank"
Opens in a new browsing context, which is usually a new tab.
"_self"
Opens in the current tab.
"_parent"
Opens in the parent browsing context, or _self
is there is none.
"_top"
Opens in the top browsing context, or _self
is there is none.
enctype
Defines the MIME type of the information sent to the server. Only works if the method is post
.
"application/x-www-form-urlencoded"
The default value.
"text/plain"
For HTML5 plain text.
"multipart/form-data"
Needed when using an <input type="file">
element.
novalidate
Tells the browser to not validate the form on submission.
No value required.