How can you allow input type="number"
to accept something like 1, 2, 3, 55
rather than just regular number
with decimal.(如何允许input type="number"
接受类似于1、2、3、55之类的东西1, 2, 3, 55
而不是仅接受带小数的常规number
。)
I tried using pattern but it didn't seems to work its magic as its still only accepting number and decimal.(我尝试使用模式,但是它似乎并没有发挥作用,因为它仍然只接受数字和小数。)
Example: <input type="number" pattern="[0-9]+([\.,][0-9]+)?"> Desired: <input type="text" pattern="[0-9]+([\.,][0-9]+)?" value="1, 2, 3, 4">
<input type="number" pattern="[0-9]+([.,][0-9]+)?">
ask by MrNew translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…