DreamTeK
DreamTeK

Reputation: 34287

HTML5 input: min prevents steps any

Can a min / max value be specified when using steps="any" or steps="0.1"?

Testing

When an input of type="number" has a min value set; steps="any" no longer allows decimals.

This input has a VALID value

<input type="number" value="12.5" steps="any">

This input has an INVALID value

<input type="number" value="12.5" steps="any" min="0">

Example Fiddle

Upvotes: 2

Views: 529

Answers (1)

Jukka K. Korpela
Jukka K. Korpela

Reputation: 201798

The correct attribute name is step, not steps. The misspelled attribute is ignored, causing the step to be defaulted to 1. So use step="any".

Upvotes: 3

Related Questions