HTML5 Input Types

Whenever your browser does not support a html5 input type, it will be turned into a text field like this.

The email type is used for input fields that should contain an e-mail address.

Depending on browser support, the e-mail address can be automatically validated when submitted.

Some smartphones recognize the email type, and adds ".com" to the keyboard to match email input.

The tel type is used for input fields that should contain a telephone number.

The tel type is currently supported only in Safari 8.

The url type is used for input fields that should contain a URL address.

Depending on browser support, the url field can be automatically validated when submitted

Some smartphones recognize the url type, and adds ".com" to the keyboard to match url input.

The date type is used for input fields that should contain a date.

Depending on browser support, a date picker can show up in the input field.

The month type allows the user to select a month and year.

Depending on browser support, a date picker can show up in the input field.

The week type allows the user to select a week and year.

Depending on browser support, a date picker can show up in the input field.

The time type allows the user to select a time (no time zone).

Depending on browser support, a time picker can show up in the input field.

The datetime type allows the user to select a date and time (with time zone).

Depending on browser support, a date picker can show up in the input field.

The datetime-local type allows the user to select a date and time (no time zone).

Depending on browser support, a date picker can show up in the input field.

The color type is used for input fields that should contain a color.

Depending on browser support, a color picker can show up in the input field.

The number type is used for input fields that should contain a numeric value.

You can set restrictions on the numbers.

Depending on browser support, the restrictions can apply to the input field.

The range type is used for input fields that should contain a value within a range.

Depending on browser support, the input field can be displayed as a slider control.