jquery - 当我们每次都关注输入字段时,如何在移动设备上触发数字键盘?
问题描述
我有一种情况,我需要将我的输入类型定义为“密码”,以便在输入字符时隐藏它们。但它需要表现得像数字。它用于 SSN 输入字段。我该怎么做?
<input id="ssn" type="tel" class="ssnentry form-control" value=""/>
$(".ssnentry").on("blur", function () {
$(this).attr("type", "password");
}).on("focus", function () {
$(this).attr("type", "tel");
});
每次输入字段被聚焦时,应该触发移动(ios)上的数字键盘。第一次尝试时,触发数字键盘。但是对于接下来的所有尝试,都会触发字母键盘。如何解决这个问题?
解决方案
推荐阅读
- arrays - BASH:在数组输出的一部分周围加双引号?
- c - 了解 UNIX fork() 如何影响父进程
- mongodb - 嵌套在数组中的数组的 MongoDB 投影
- python - Gurobi Python:代码是否满足约束?
- protractor - Angular 应用程序的量角器:E/启动器进程退出,错误代码为 199 - Chrome 挂断数据:
- mysql - Mysql用汇总和注释表
- tensorflow - 我的归一化数据集在 0 和 1 之间的好 MSE 和 RMSE 是什么
- graphql - Gatsby - 使用 createRemoteFileNode 获取远程图像
- sql-server-2008 - 优化 SQL - 在变量存在时为 JOINS 和混乱换出函数
- r - R:在ggtitle的标题中使用希腊字母