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" />

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s