<input type="password" id="pw" name="pw" style="width: 200px;">
<input type="checkbox" id="showPass" οnclick="aaa();">显示密码
function aaa() {
var passType = document.getElementById('pw').type;
if(passType == "text"){
document.getElementById('pw').type = "password";
}else{
document.getElementById('pw').type = "text";
}
}