input标签当type为number时,只能输入数字
其中有max和min属性,是限制输入数字的大小,当想输入小数时,可以把步数step改为小数,如step = 0.1
如:
<input type = "number" value = "10" max = "20" min = "10" step = "0.1">
type为number的input标签输入小数的方法
原文:https://www.cnblogs.com/yang-xiansen/p/10894441.html