How to restrict number of characters that can be entered in HTML5 number input field on iPhone

前端 未结 10 1529
野趣味
野趣味 2020-12-14 02:19

It seems that neither of the \"maxlength\", \"min\" or \"max\" HTML attributes have the desired effect on iPhone for the following markup:

 

        
10条回答
  •  無奈伤痛
    2020-12-14 02:40

    as Andrew said you need to change the type to range, beside that you are going to have problems with IE and FF and probably old ipad browser because that's from HTML 5, and it's a "Kind New". Take a look to this person who tried the range with JS, Specify range of numbers to input in number field using javascript

提交回复
热议问题