HTML5 brings New Elements, new Attributes and New Form Controls for better, faster and smarter forms.
New Attributes in HTML5 Form
HTML5 Form includes some more attributes. Exp autofocus, placeholder, required, autocomplete, pattern, list etc.
Here are all html5 form elements with examples and use.
autofocus attribute focus that single particular input on page load. Can be used once on a webpage.
<input type="text" autofocus >
placeholder shows hint of value. It disappear on focus or keypress event.
<input type="text" placeholder="Enter Name" >
autocomplete can show or hide browser cache on keyup. Default value off shows cache data on keyup. But autocomplete off can disable browser cache.
HTML5 also includes some new input types with validations. These types works on both Desktops based browsers and Mobile based browsers.
input type number
input type number is used to insert only numbers from user. For example age, number etc. min and max attributes are also used with input type number. step can increase step value, default step value is 1.
input type number can change keyboard layout on smartphones like android and iphone.