HTML5 Input Attributes
HTML5 brings more than twelve new input attributes for form input element. These input attributes make development life easier while delivering a delightful user experience. Using HTML5 input attributes you can reduce the number of lines of javascript code, which you are used to set focus, set as require field, add regular expression patter, display suggestion list while user start typing charecter etc.
In this tutorials you will learn step by step each HTML5 input attribute and learn why you should be using them right now. The new input attributes we'll be looking at are listed below:
HTML5 Input Attributes
Attributes | Description | Browser Supported |
Placeholder | This attribute is used to provide hint to the user. |
|
List | This attribute is used to display suggesion list. |
|
Autofocus | This attribute is used to set focus for input textbox automatically. |
|
Required | This attribute is used to set input field require. |
|
Pattern | This attribute is used to implement specific validation, similar to regular expression. |
|
Autocomplete | This attribute is autocomplete input based on earlier input |
|
Multiple | This attribute is used to enter more than one value. |
|
Formnovalidate | This attribute is used to ignore the validation. |
|
Form | This attribute is used to set input element belong to multiple form. |
|
Form Action | This attribute is used to specifies the file that will submit the form. |
|
Formenctype | This attribute is used to specifies how the form-data is encoded. |
|
Formmethod | This attribute is used to specifies which HTTP method should be used to submit the form data. |
|
Formtarget | This attribute is used set target window for the form results. |
|
To know more details about each input type, click on input type given in above table.