您的位置:首页 > 移动开发 > IOS开发

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

2016-03-11 09:30 288 查看
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)的支持,也就尽量不要使用了。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息