js实现密码输入框切换显示和隐藏

JS实现密码输入框切换显示和隐藏
点击eye图标,实现密码框显示与隐藏切换
open() {
var getPassword = document.getElementById(“password”);
//判断输入框的类型:password或者text
if (getPassword.type == “password”) {
getPassword.type = “text”;
this.pic = require("…/…/assets/login/open_eye.png"); //小图标
} else {
getPassword.type = “password”;
this.pic = require("…/…/assets/login/close_eye.png");
}
},

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-29
  • 2022-12-23
  • 2021-11-04
  • 2022-12-23
  • 2022-01-19
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-04
  • 2022-12-23
  • 2022-12-23
  • 2021-07-13
  • 2022-12-23
相关资源
相似解决方案