<input type="password" value="" onblur="aa(this.value)"/><span id="span" style="display:none"><font color="red">你的密码位数需要5-8位</font></span>
js:
function aa(value){
if(value.length<5||value.length>8){
document.getElementById("span").style.display="block"
}
}
<script language = JavaScript>
function password() {
var testV = 1
var pass1 = prompt('请输入密码:', '')
while (testV <3) {
if (!pass1) history.go(-1)
if (pass1 == "123456") {
alert('密码正确!')
break
}
testV += -1
var pass1 = prompt('密码错误!请重新输入:')
}
if (pass1 != "password" &testV == 3) history.go(-1)
return " "
}
document.write(password())
</script>
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)