demo
超简单,就是切换 input 框的 type 类型:
function isShow() { let input = document.getElementById('inputId') // input的dom if (input.type == 'password') { input.type = 'text' // 显示 } else { input.type = 'password' // 隐藏 } }
← 网页标题/标签 闪烁 跳转/刷新保存请求/console →