The form attribute specifies the parent form of an html form element.
Applies to [html/elements/input](/html/elements/input)By default, an html element related to a form is associated with it's nearest parent [form](/html/elements/form). The form attribute can be used to override or specify this. This can allow for nested forms, or inputs, buttons, etc. outside of forms, yet associated with them.
The value of the form attribute should be the id of a form that exists on the same page.
NotesNote that a document conforming to the HTML specifications will never have nested form elements (the primary use for this attribute). However, javascript can make this situation occur.
Related specificationsform
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4