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

AttributesDescriptionBrowser Supported
Placeholder This attribute is used to provide hint to the user.
ListThis attribute is used to display suggesion list.
AutofocusThis attribute is used to set focus for input textbox automatically.
RequiredThis attribute is used to set input field require.
Pattern This attribute is used to implement specific validation, similar to regular expression.
AutocompleteThis attribute is autocomplete input based on earlier input
MultipleThis 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.
FormenctypeThis 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.