Get to know MDN better
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
The <form> HTML element represents a document section containing interactive controls for submitting information.
It is possible to use the :valid and :invalid CSS pseudo-classes to style a <form> element based on whether the elements inside the form are valid.
This element includes the global attributes.
acceptComma-separated content types the server accepts.
Note: This attribute has been deprecated and should not be used. Instead, use the accept attribute on <input type=file> elements.
The character encoding accepted by the server. The specification allows a single case-insensitive value of "UTF-8", reflecting the ubiquity of this encoding (historically multiple character encodings could be specified as a comma-separated or space-separated list).
autocapitalizeControls whether inputted text is automatically capitalized and, if so, in what manner. See the autocapitalize global attribute page for more information.
autocompleteIndicates whether input elements can by default have their values automatically completed by the browser. autocomplete attributes on form elements override it on <form>. Possible values:
The name of the form. The value must not be the empty string, and must be unique among the form elements in the forms collection that it is in, if any. The name becomes a property of the Window, Document, and document.forms objects, containing a reference to the form element.
relControls the annotations and what kinds of links the form creates. Annotations include external, nofollow, opener, noopener, and noreferrer. Link types include help, prev, next, search, and license. The rel value is a space-separated list of these enumerated values.
The following attributes control behavior during form submission.
actionThe URL that processes the form submission. This value can be overridden by a formaction attribute on a <button>, <input type="submit">, or <input type="image"> element. This attribute is ignored when method="dialog" is set.
enctypeIf the value of the method attribute is post, enctype is the MIME type of the form submission. Possible values:
This value can be overridden by formenctype attributes on <button>, <input type="submit">, or <input type="image"> elements.
methodThe HTTP method to submit the form with. The only allowed methods/values are (case insensitive):
This value is overridden by formmethod attributes on <button>, <input type="submit">, or <input type="image"> elements.
novalidateThis Boolean attribute indicates that the form shouldn't be validated when submitted. If this attribute is not set (and therefore the form is validated), it can be overridden by a formnovalidate attribute on a <button>, <input type="submit">, or <input type="image"> element belonging to the form.
targetIndicates where to display the response after submitting the form. It is a name/keyword for a browsing context (for example, tab, window, or iframe). The following keywords have special meanings:
This value can be overridden by a formtarget attribute on a <button>, <input type="submit">, or <input type="image"> element.
| Flow content, palpable content |
| Flow content, but not containing <form> elements |
| None, both the starting and ending tag are mandatory. |
| Any element that accepts flow content |
| form |
| search, none or presentation |
| HTMLFormElement |
| HTML # the-form-element |
Enable JavaScript to view this browser compatibility table.
This page was last modified on Apr 24, 2026 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.