Home  >  Article  >  Web Front-end  >  html 中的 input,怎样触发 iOS 中不同类型的键盘?

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

WBOY
WBOYOriginal
2016-06-07 08:44:372161browse

比如输入email的,就是带@和.的那个键盘,如知乎首页的登陆框
或者输入数字的,就是那个九宫格数字键盘

回复内容:

iOS Webkit 内核支持一些特有的 input type,比如 email、number、url 等等,
此外,还有 autocorrect、autocapitalize 等选项。

参考:
  • 苹果官方开发文档:developer.apple.com/lib
  • 介绍各种 iOS HTML input 键盘:sja.co.uk/post/controll
通过 `type` 改变键盘布局的原理有人回答了,我补充一下通过 `appearance` 来绕开 `type` 的限制的方法:
jsfiddle.net/chrisyipw/ html 中的 input,怎样触发 iOS 中不同类型的键盘? 如果类型是search的话,需要把input放在一个action为空的form中,例如:


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn