Share
Input Type - number
The number type is used for input fields that should contain a numeric value.
You can also set restrictions on what numbers are accepted:
Points: <input type="number" name="points" min="1" max="10" />
Use the following attributes to specify restrictions for the number type:
| Attribute | Value | Description |
| max | number | Specifies the maximum value allowed |
| min | number | Specifies the minimum value allowed |
| step | number | Specifies legal number intervals (if step="3", legal numbers could be -3,0,3,6, etc) |
| value | number | Specifies the default value |
Tip: Safari on the iPhone recognizes the number input type, and changes the on-screen keyboard to match it (shows numbers).