HTML <input type="submit"> (original) (raw)
Last Updated : 23 May, 2026
The HTML element is used to create a submit button in a form. It sends the form data to the server when clicked.
- Used to submit form data to the server.
- Created using inside a element.
- Supports attributes like value, disabled, and formaction.
**Syntax:
Attributes
- **value: Specifies the text displayed on the submit button.
- **name: Defines a name for the submit button used in form data.
- **disabled: disabled disables the submit button and prevents form submission.
- **form: Specifies the form associated with the submit button.
- **formaction: formaction defines the URL where form data is sent for processing.
- **formenctype: formenctype specifies how form data should be encoded before submission.
- **formmethod: formmethod specifies the HTTP method (GET or POST) used for form submission.
- **formtarget: formtarget specifies where to display the response after form submission.
- **autofocus: autofocus automatically focuses the submit button when the page loads.
- **formnovalidate: formnovalidate prevents form validation during form submission.
**Note: The form handler is defined in the action attribute of the form.
**Example: We are using the HTML to create a submit button for a form. When clicked, it submits the form data (username and password) to the server for processing.
html `
HTML <input type="submit">
<form action="#">
<label for="uname">User Name:</label>
<input type="text" id="uname">
<br><br>
<label for="pwd">Password:</label>
<input type="password" id="pwd">
<br><br>
<input type="submit" value="Submit">
</form>
`