使用方法
const inputIcon = document.querySelector(".input-icon");
inputIcon.addEventListener("click", toggleVisibility);
function toggleVisibility() {
const input = document.querySelector("#password");
const toggleIcon = document.querySelector(".input-icon i");
if (input.type === "password") {
input.type = "text";
toggleIcon.className = "fas fa-eye-slash";
} else {
input.type = "password";
toggleIcon.className = "fas fa-eye";
}
}
站长提示:
1. 平台上所有素材资源,需注册登录会员方能正常下载。
2. 会员用户积极反馈网站、素材资源BUG或错误问题,每次奖励
20K币。
3. PHP源码类素材,如需协助安装调试,或你有二次开发需求,可联系苦力吧客服。
4. 付费素材资源,需充值后方能下载,如有任何疑问可直接联系苦力吧客服