【问题标题】:About input type="number" open number pad in mobile but how open numpad for input type="password"关于输入类型=“数字”在手机中打开数字键盘但如何打开输入类型=“密码”的数字键盘
【发布时间】:2018-01-29 05:04:37
【问题描述】:

我正在尝试在移动浏览器中打开数字键盘<input type="password" /> 但我无法做到这一点

当我设置<input type="number" /> 在我的 HTML 页面中,当查看器单击此字段时,移动浏览器会打开此字段的数字键盘
我如何强制移动浏览器打开数字键盘以输入<input type="password" />

【问题讨论】:

  • 一般情况下键盘上都有数字输入密码

标签: javascript html mobile browser numpad


【解决方案1】:

webkit浏览器解决方案(将数字类型输入的文本显示为光盘)

#numberPassword {
  -webkit-text-security: disc;
}
<input type="number" id="numberPassword" />

【讨论】:

  • 谢谢你,我把我的页面,但它显示其内容而不是密码形式(***),它不能正常工作
  • 它不起作用,仍然显示没有密码格式的数字
  • 您在哪个浏览器中测试?上面的 sn-p 对你有用吗?
【解决方案2】:

#numberPassword {
  -webkit-text-security: disc;
}
<input type="number" id="numberPassword" />

【讨论】:

    猜你喜欢
    • 2015-05-24
    • 2019-04-23
    • 2017-07-21
    • 2017-04-20
    • 1970-01-01
    • 2019-11-15
    • 2017-12-04
    • 1970-01-01
    • 2015-12-01
    相关资源
    最近更新 更多