An HTML form with two different input types; text and submit:
![]()
The type attribute is supported in all major browsers.
The type attribute specifies the type of <input> element to display.
The default type is: text.
Tip: This is not a required attribute, but we think you should always include it.
| Value | Description |
|---|---|
| button | Defines a clickable button (mostly used with a JavaScript to activate a script) |
| checkbox | Defines a checkbox |
| file | Defines an input field and a "Browse..." button, for file uploads |
| hidden | Defines a hidden input field |
| image | Defines an image as a submit button |
| password | Defines a password field. The characters in this field are masked |
| radio | Defines a radio button |
| reset | Defines a reset button. A reset button resets all form fields to their initial values |
| submit | Defines a submit button. A submit button sends form data to a server |
| text | Defines a one-line input field that a user can enter text into. Default width is 20 characters |
Define a single-line text field that a user can enter text into:
A clickable button, that activates a JavaScript when it is clicked:
Checkboxes let a user select one or more options of a limited number of choices:
Define a file-select field and a "Browse..." button (for file uploads):
Define a hidden field (not visible to a user). A hidden field often store a default value, or can have its value changed by a JavaScript:
Define an image as a submit button:
Define a password field (characters are masked)
Radio buttons let a user select only one of a limited number of choices:
Tip: Use the reset button carefully! It can be annoying for users who accidentally activate the reset button.
Define a reset button (resets all form values to default values):
HTML <input> tag
| WEB HOSTING |
|---|
| Best Web Hosting |
| PHP MySQL Hosting |
| Best Hosting Coupons |
| UK Reseller Hosting |
| Cloud Hosting |
| Top Web Hosting |
| $3.98 Unlimited Hosting |
| Premium Website Design |
| WEB BUILDING |
|---|
| XML Editor - Free Trial! |
| FREE Website BUILDER |
| Best Website Templates Top CSS Templates |
| CREATE HTML Websites |
| EASY WEBSITE BUILDER |
| W3SCHOOLS EXAMS |
|---|
|
Get Certified in: HTML, CSS, JavaScript, XML, PHP, and ASP |
| W3SCHOOLS BOOKS |
|---|
|
New Books: HTML, CSS JavaScript, and Ajax |
| STATISTICS |
|---|
|
Browser Statistics Browser OS Browser Display |
| SHARE THIS PAGE |
|---|