HTML5 introduce 13 new Input type values for the type attribute for HTML <input> element. By using new input type values we can create more attractive page, better input control and can validate to input type values. Most of the browser does not support HTML5 new input types except “Opera”.
HTML5 new Input Types:
- color
- number
- time
- month
- search
- url
- date
- week
- datetime
- range
- datetime-local
- range
Search: This input type value specify textbox as a search box.
Search <input type="search" name="search" />
Tel,Url and Email: These input type values represent textbox as a telephone number, Web url and email address respectively.
Telephone <input type="tel" name="tel" />
Url <input type="url" name="urlname" />
Email <input type="email" name="sendmail" />
Date and Time: Six new input types (datetime, datetime-local, date, month week, time) specify with dates and times in one form or another.
Datetime<input type="datetime" name="date&time" />
Datetime-local<input type="datetime-local" name="localdate&time" />
Date<input type="date" name="date" />
Month <input type="month" name="mnth" />
Week <input type="week" name="wk" />
Time <input type="time" name="tm" />
Numerical input types: two new input types (number and range) specify entered value should be numeric and given range respectively.
Number <input type="number" name="num" />
Range<input type="range" name="points" min="1" max="10" />
Color input type: The color type is used for input fields that should contain a color.
Color <input type="color" name="clr" />
Leave Comment