带有小数点的iPhone数字小键盘,用于编辑DIV上的网页应用程序 [英] iPhone Numeric Keypad with Decimal for web apps on a editable DIV
问题描述
我的DOM有一个< div contenteditable =true> $ c $触发容器时触发iOS上显示的键盘。到目前为止情况非常好,但在特殊情况下,我希望用户输入带小数的数字,所以我想在iOS上触发一个具有十进制支持的数字小键盘(以后在所有的移动连续播放器上)。
任何人都可以告诉我如何CSS或属性我的容器来获得所需的数字键盘?
I认为你应该用下面的代码替换你当前的输入标签
< input type =numberpattern =[0- 9] */>
这实际上是告诉iOS(和Android)浏览器使用大数字键盘。
欲了解更多详情,请参阅这里。
I built a webapp for mobile.
My DOM has a <div contenteditable="true">
which triggers a keyboard showing up on iOS on touch into the container. So far so good, but in the particular case, I want the user to enter numbers with decimals, so I would like to trigger a numpad with decimal support on iOS (on all mobile broswers later).
Can anyone tell me how to CSS or attribute my container to get the desired numpad?
I think you should replace your current input tag with the following one
<input type="number" pattern="[0-9]*" />
That's actually telling iOS (and Android) browser to use the large numpad.
For more details see here.
这篇关于带有小数点的iPhone数字小键盘,用于编辑DIV上的网页应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!