前端屏蔽中文输入法 input输入框type password 显示明文 (输入密码时屏蔽输入法)

2023-03-23 18:02:00 听风 思思

1、input输入框如果type=password能满足我们的需求,但是是密文,我们要明文显示,实现源码如下:

!DOCTYPE html

html lang="en"

head

    meta charset="UTF-8"

    meta name="viewport" content="width=device-width, initial-scale=1.0"

    title屏蔽输入法/title

/head

style

  body{

    background-color:rgb(220, 220, 255);

  }

  #password,#clear{

    position: absolute;

  }

  #password{

    opacity: 0;

    border: 0px;

    width: 1px;

    z-index: 999;

  }

  #clear{

    outline: none;

    color:rgb(214, 124, 6);

    width: 95%;

    background-color: rgba(255, 255, 255, 0.2);

    border: none;

    height: 40px;

    text-indent: 15px;

    border-radius: 5px;

  }

/style

body

    input type="password" id="password"/

    input type="text" placeholder="请扫描输入内容" id="clear" /

/body

script src=""/script

script

//聚焦clear

$('#clear').focus();

//监听clear输入框

$('#clear').bind('input propertychange', function()

{

  //聚焦password

  $('#password').focus();

  //将clear赋值给password

  $('#password').val($("#clear").val());

  //延迟200毫秒聚焦clear

  setTimeout(function(){

            $("#clear").focus();

        }, 200)

})

//监听password输入框

$('#password').bind('input propertychange', function()

{

  //将password赋值给clear

  $('#clear').val($("#password").val());

  //延迟200毫秒聚焦clear

  setTimeout(function(){

            $("#clear").focus();

        }, 200)

})

/script

/html

我想问一下这个输入法怎么关,我的手机是vivo的这个输入法每次在我输密码的时候出来很烦。

您好,您可以进入设置--更多设置--输入法--点击vivo输入法--选择恢复默认设置试试的,或者是进入设置--更多设置--应用程序--全部--找到vivo输入法清除数据之后再使用的。

输锁屏密码出现禁止QQ输入法是什么意思?

不要用第三方输入法,这是一种安全措施。必须要用手机自带的,以防第三方软件有太高的权限,威胁到手机数据的安全。