Limit number of characters in input type number

后端 未结 13 1697
逝去的感伤
逝去的感伤 2020-12-18 08:08

Im trying to limit to X number the characters in a input (type of number). ive tried a lot of options and none seems to work. I dont want to use the option tel as it needs t

相关标签:
13条回答
  • 2020-12-18 08:46

    I think this requires the onkeyup event handler.

    Use this handler to keep on entering numbers till 5 keyup's are encountered. After this , don't let the the number to be entered by returning a 0, unless key pressed is backspace or delete .

    0 讨论(0)
提交回复
热议问题