A key component of interactive web systems, input tags are HTML elements designed to take a specific form of input from users. Different types of input elements can regulate the data entered to fit a specified format and provide security to password entry.
<input type="" name="" value="">
|class||Indicates the Class of the input|
|id||Indicates the ID of the input|
|type||Identifies the type of input control to display. Acceptable values are |
|name||Indicates the name of the input|
|disabled||Boolean value that indicates the input should be disabled. Disabled controls cannot be edited, are not sent on form submission, and cannot receive focus.|
|checked||When the value of the type attribute is radio or checkbox, the presence of this Boolean attribute indicates that the control is selected by default; otherwise it is ignored.|
|multiple||HTML5 Indicates multiple files or values can be passed (Applies only to |
|placeholder||HTML5 A hint to the user of what can be entered in the control . The placeholder text must not contain carriage returns or line-feeds|
|autocomplete||HTML5 Indicates whether the value of the control can be automatically completed by the browser.|
|readonly||Boolean value that indicates the input is not editable. Readonly controls are still sent on form submission, but will not receive focus. HTML5: This attribute is ignored when the value of |
|required||HTML5 Indicates a value must be present or the element must be checked in order for the form to be submitted|
|alt||An alternative text for images, in case they are not displayed.|
|value||Specifies the value of |
As with other HTML5 void elements,
<input> is self-closing and may be written
<input />. HTML5 does not require this slash.
The following are valid input types in HTML:
The following are newly introduced input types as a part of HTML 5 standard. Some of these types are not supported by all web browsers. In the case where a type is not supported, the input element will default to the
To check which browsers support which types, you can go to caniuse.com.