if I use input type="number" the default keyboard is numeric on mobile. But I prefer type="text", because my input is PIN which can begin with 0, and I need some other attributes: minlength, maxlength, pattern
I wonder if it's possible to force numeric keyboard on mobile for other type than numeric and tel?
You can do <input type="text" pattern="\\d*" inputmode="numeric">
. This will cause the numeric keyboard to appear.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.