javascript - 动态输入掩码 - 一个输入的两个掩码
问题描述
有人帮我弄清楚为什么在这里做错了吗?
我的输入字段需要有两个掩码选项:
00000000000-0(- 前 11 个数字)或 000000000000-0(- 前 12 个数字)
这是我的代码:
$('#' + account).inputmask({
//mask: ['99999999999-9', '999999999999-9'], (I used this way before, works, but when I put mouse over the field, it automatically change the mask to the bigger one)
mask: "(99999999999-9)|(99999999999{1}-9)",
placeholder: '0',
numericInput: true
});
解决方案
推荐阅读
- mysql - 创建查询以选择从最贵到最便宜的所有设备
- javascript - 滚动上的动画“幻灯片”
- typescript - 间接返回值时,打字稿类型“字符串”不可分配给类型
- swiftui - swiftui 状态变量计数丢失了它存储的内容
- python - windows上的python权限被拒绝
- python - 从网站上的图表中抓取数据,只有将鼠标悬停在图表上才能看到
- python - Python 的“setuptools”不包括自动生成的 SWIG Python 文件
- laravel - 如何仅保护我的控制器的特定路由?
- java - java中如何获取LinkedList的头节点?
- parsing - 在 `std::string::String` 中找不到 .next() 方法