Javascript 动态改变imput type属性:
代码实现:
Box){
var ps = document.getElementById('ps');
var pass = document.getElementById('pass');
ps.removeChild(pass);
var psImput = document.createElement("INPUT");
if(pass.type == 'password'){
psImput.type = "text";
} else {
psImput.type = 'password';
}
psImput.id = 'pass';
psImput.name = "password";
psImput.maxlength="15";
ps.appendChild(psImput);
}
登录密码: