Chrome auto formats input=number

后端 未结 8 1680
轻奢々
轻奢々 2020-12-02 16:20

I have a web application where I\'m specifying an input field to be a number using the HTML5 property type=\"number\".



        
8条回答
  •  佛祖请我去吃肉
    2020-12-02 17:09

    Number is one of the new HTML5 input types. There are loads of these - email, date, time, url, etc. However, I think only Chrome has implemented them so far. The others fall back to using the default type (text).

    For more info about HTML5 input types: http://diveintohtml5.ep.io/forms.html

    If you want to disable it on Chrome, you could leave as text and change it to number if the user device is a handheld. Since it's not a usability killer if the user device sniffing gives the wrong result, you shouldn't have any problems.

提交回复
热议问题