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

前端 未结 26 2482
感动是毒
感动是毒 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:34

    it's very simple, with some javascript you can simulate a maxlength, check it out:

    //maxlength="2"
    
    

提交回复
热议问题