Input Types
HTML input type="submit"
Submit the associated form. The value supplies the visible button label. Only the activated submitter contributes its own name/value to ordinary submission. Use a clear action label. Use only attributes applicable to this input state; the browser ignores or rejects unrelated constraints. Validate submitted data on the server.
Formal Syntax & Structure
html syntaxhtml
<input type="submit">Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| type | literal submit | Selects the submit input state. |
| name | string | Provides an element-specific name: a form field key, radio group name, named frame, metadata key, slot name or other defined purpose. Its meaning depends on the element; it is not a unique DOM identifier. |
| disabled | boolean | Disables supported controls or elements. Disabled form controls are generally not focusable, validated or submitted. The exact effect depends on the element; disabled="false" still disables. |
| form | form element ID | Associates an eligible control with a form elsewhere in the same document, overriding an ancestor form where applicable. Does not automatically associate descendants of a fieldset. |
| value | element-dependent text or number | Default value or submitted value depending on type. A file input cannot be prefilled with a path. |
| formaction | URL | Overrides the associated form's submission destination for this submit button or image submit input. |
| formenctype | form encoding keyword | Overrides the associated form's encoding when this submit control initiates submission. Use multipart/form-data for file upload requests. |
| formmethod | enumerated: get, post, dialog | Overrides the form submission method for a particular submit control. dialog closes an associated dialog instead of making an ordinary network submission. |
| formnovalidate | boolean | Bypasses native constraint validation when the corresponding submit control is used. Server-side validation is still required. |
| formtarget | browsing context name or keyword | Overrides the target browsing context for the submission initiated by this control. |
Return Value
HTMLInputElement
Void form-associated element; no child content. The DOM value and form-submission behavior depend on the input state.
Working Example
Example Snippethtml
<form method="get"> <label> Query <input name="q"> </label> <input type="submit" value="Search"></form>