html 中的 input,触发 iOS 中不同类型的键盘

html 是通过input标签的type属性来触发不同的键盘类型的。

我们常用的type是text和password,即:

账户:<input type="text" value="" />
密码:<input type="password" value="" />

而要触发移动设备上的数字键盘搜索,就需写成:

<input type="number" pattern="[0-9]*">  
<input type="number" value="" />
<input type="tel" value="" />

触发邮件键盘(键盘上带有“@”符号可输入),就写成:

<input type="email" value="" />

需要进行内容搜索,就写成:

<input type="search" value="" />

当然还有一些其它的,不过大多都得不到浏览器(或者App里的webview)的支持,也就尽量不要使用了。

おすすめ

転載: blog.csdn.net/u012477117/article/details/50853257