当使用input标签作为type="tel"触摸设备上的键盘时,输入框的类型对应.但是,我希望input隐藏标签中的值(与password类型一样).正常的行为是在用户输入时隐藏每个角色.
<input type="tel">
Run Code Online (Sandbox Code Playgroud)
input [type="tel"] {
-webkit-text-security: disc;
}
Run Code Online (Sandbox Code Playgroud)
此解决方案适用于大多数浏览器,但不适用于IE.
<input type="password" pattern="[0-9]*" inputmode="numeric">
Run Code Online (Sandbox Code Playgroud)
此解决方案无法按预期工作.
有没有办法完成我想要做的事情?
-webkit-text-security:光盘;css 属性在 Firefox 浏览器中不起作用
mozilla 中是否有任何替代方案?请帮忙