Html5 数字输入步长和精度 [英] Html5 number input step and precision
本文介绍了Html5 数字输入步长和精度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我不知道如何定义输入[数字]的步长值和精度
I can't find out how to define a step value and a precision to a input[number]
1.01
被认为是无效的,直到我指定了 0.01
的步骤.但在那种情况下,我无法指定具体步骤.
1.01
is considered as invalid until I specify a step of 0.01
.
But In that case I can't specify a specific step.
与大数字相同的问题.如果我指定 1000
的步骤并且用户键入 1001
,则该值被视为 无效...
Same issue with big number. If I specify a step of 1000
and the user type 1001
the value is considered invalid...
你可以看看这个例子
推荐答案
我猜您想禁用步骤验证.如果是这样,step="any"
应该可以工作.
I guess you want to disable step validation. If so, step="any"
should work.
这篇关于Html5 数字输入步长和精度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文