type="number"
The input element represents a control for setting the element’s value to a string representing a number. 4.10.5.1.12. Number state (type=number)
Links about type="number"
Why the GOV.UK Design System team changed the input type for numbers
We take a look at why the GOV.UK Design System changed the element it uses for inputting numbers, making it more accessible and easier to use
Tags:You probably don’t need input type=“number”
Last week I got a call from my bank regarding a wire transfer I had just scheduled. The customer support guy had me repeat everything back to him because there seemed to be a problem with the information. “Hmmmm, everything you said is right right except the last 3 digits of the account number.”
Tags:<input type=“number”>
input elements of type number are used to let the user enter a number. They include built-in validation to reject non-numerical entries.
Code sample
<label>
How much do you want to charge?
$<input type="number" min="0" step="0.01">
</label>
Explore other pages
- aria-details
Identifies the element that provides a detailed, extended description for the object.
- line-height
Specifies the height that is used in the calculation of the line box height.
- nav
Represents a section of a page that links to other pages.
- content
Dictates what is rendered inside an element or pseudo-element.