密码显示和隐藏

var psw=$(this).parent().find(".password");
if ($(psw).attr("type") == "password") {
$(psw).attr("type", "text")
}
else {
$(psw).attr("type", "password")
}

原文地址:https://www.cnblogs.com/ch-zaizai/p/6068260.html