解决扫码枪输入input时受中文输入法的影响
<html><head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<title>Image preview example</title>
</head>
<body>
<div style="position: relative;width: 200px;">
<input name="password" autocomplete="off" hidden id="password">
<input type="password" autocomplete="off" class="pad-input" style="height: 30px;width: 100%;">
<input placeholder="请输入密码" id="show" type="text" style="position: absolute;left: 3px;top:50%;transform: translate(0,-50%);border: none;height: 28px;pointer-events: none;background: #fff;width: 98%;" disabled>
</div>
<script>
var obj = {};
Object.defineProperty(obj, 'txt', {
get: function () {
return obj;
},
set: function (newValue) {
document.getElementsByClassName("pad-input")[0].value = newValue;
document.getElementById('show').value = newValue;
document.getElementById('password').value = newValue;
}
});
document.getElementsByClassName("pad-input")[0].addEventListener('keyup', function (e) {
obj.txt = e.target.value;
});
</script>
</body>
解决扫码枪输入input时受中文输入法的影响的更多相关文章
- input事件以及中文输入法的处理
在项目的开发过程中,相信大家都处理过监听用户输入的事情,一般我们会用到onkeyup.onkeydown.onkeypress.onchange.oninput事件,虽然都很熟悉了,但是还是有必要巩固 ...
- C# Textbox的ImeMode取值对中文输入法的影响 (转)
摘自:http://blog.csdn.net/jhycjhyc/article/details/6578570 C# Textbox的ImeMode取值对中文输入法的影响 取值 ...
- C# Textbox的ImeMode取值对中文输入法的影响(进入才能看清)
原文:C# Textbox的ImeMode取值对中文输入法的影响(进入才能看清) C# Textbox的ImeMode取值对中文输入法的影响 取值 五笔加加 微软拼音3.0 搜 ...
- JS对输入判断变化屏蔽中文输入法输入时连续触发事件的方法
代码如下: //智能搜索提示 IntelligenceSearch: function IntelligenceSearch() { $('#keyWord').on('input', functio ...
- compositionEnd 和 input 事件(中文输入法问题)
网上用 compositionstart + compositionend + input 解决中文输入法问题的办法 node.addEventListener('compositionstart', ...
- JS 对输入判断变化屏蔽中文输入法连续输入时触发的事件
//智能搜索提示 IntelligenceSearch: function IntelligenceSearch() { $('#keyWord').on('input', function () { ...
- CentOS解决因python升级导致的中文输入法无法正常使用的问题
/usr/libexec/ibus-ui-gtk /usr/ bin/ibus-setup /usr/libexec/ibus-engine-table 将以上三个文件中的 “exec python” ...
- 移动端解决fixed和input获取焦点软键盘弹出影响定位的问题
场景描述, 当document的高度不够window的高度时候,如在ip6中文档的高度比窗体的高度小,到底设计在最下方的区域没有在窗体最下方,就留有空白地方如下图的灰色部分 1. 解决初始化文档高度, ...
- (转)C# Textbox的ImeMode取值对中文输入法的影响
取值 五笔加加 微软拼音3.0 搜狗拼音 说明 NoControl 首次调出后按一次ctrl+space才能正确使用 中西标点或全半角字符继承上次设置 调出后默认为英文输入状态 调出后默认为西文标点 ...
随机推荐
- ubuntu 18.04 gcc g++降级4.8版
$ sudo apt-get install -y gcc-4.8 $ sudo apt-get install -y g++-4.8 $ cd /usr/bin $ sudo rm gcc $ su ...
- 【nginx】常用命令 启动|停止|重启|重新读取配置-centOS7
查看服务的当前状态 (flaskApi) [root@67 goTest]# systemctl status nginx.service ● nginx.service - The nginx H ...
- 阶段3 1.Mybatis_11.Mybatis的缓存_5 缓存的概念
2.Mybatis中的缓存 什么是缓存 存在于内存中的临时数据. 为什么使用缓存 减少和数据库的交互次数,提高执行效率. 什么样的数据能使用缓存 ...
- 【奇技淫巧】使用 SSH 转发 Sock5 流量
标题:使用 SSH 转发 Sock5 流量 日期:2018-06-27 介绍:使用 ssh 来做个 sock5 的代理,穿透到内网中做后渗透 0x01. 基本信息 在 ubuntu(10.211.55 ...
- windows 下使用Linux子系统
在 Windows 上进行 web 开发,比较普遍的方案是使用 phpstudy 或者别的一些集成环境软件进行环境搭建,写好代码后将代码上传至版本管理工具 git/svn,再将代码同步到 Linux ...
- IntelliJ IDEA调试时,格式化显示日期变量
格式化前: 格式化后: new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this); 入门常用知识: Ct ...
- centos7 主从dns配置 bind服务
一,配置前请先关闭防火墙selinux 防火墙关闭方法,参见上一篇文章. setenforce 0 #临时关闭 修改/etc/selinux/config 文件 将SELINUX=enforc ...
- TensorFlow2.0矩阵与向量的加减乘
1.矩阵加法使用 a = np.random.random((3,3))b = np.random.randint(0,9,(3,3)) ad = tf.add(a,b) 2.矩阵乘法注意 # ten ...
- 【Qt开发】设置中心窗口 setCentralWidget
http://blog.csdn.net/qter_wd007/article/details/7028920 Qt程序中的主窗口通常具有一个中心窗口部件.从理论上来讲,任何继承自QWidget的类的 ...
- IDEA中解决 git pull 冲突
0.事先准备.1)把远程仓库的README.md内容改写为bbb(原先为aaa). 2)本地仓库的README.md内容改写为ccc(原先也为aaa). 以此来模仿代码冲突. 1.先commit ...