📜  如何制作显示密码按钮 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:12.996000             🧑  作者: Mango

代码示例1
function myFunction() {
  var x = document.getElementById("*passwordbox-id*");
  if (x.type === "password") {
    x.type = "text";
  } else {
    x.type = "password";
  }
}