How can I limit possible inputs in a HTML5 “number” element?

前端 未结 26 2820
感动是毒
感动是毒 2020-11-22 05:12

For element, maxlength is not working. How can I restrict the maxlength for that number element?

26条回答
  •  野性不改
    2020-11-22 05:17

    Max length will not work with the best way i know is to use oninput event to limit the maxlength. Please see the below code for simple implementation.

    
    

提交回复
热议问题