I have HTML input which is set to be a numeric input including the up and down carets. To my surprise I am unable to enter any decimal numbers.
<input type="number" />
It does not accept such input and jumps back to a non-decimal number. Is there any way I can keep the input type numeric and still allow decimal numbers?
2
Answers
you can use
step
attribute to say the number input allow decimalIf you want to allow any number of decimal then use this:
If you want specific like two decimal places then set like this:
Hope it helps!