HTML5 input type=number and decimals/floats

if you want all the numbers to be valid, integers and decimals alike? In this case, set step to “any”
if you only want to accept positive numbers, you’ll want to add min=”0″.

<input type="number" step="any" />
<input type="number" min="0" />
Advertisements