随便写写
var account_name= document.getElementById('username'); var password = document.getElementById('password'); var repassword = document.getElementById('password-2'); if(new RegExp('^\\w{3,10}$').test(account_name.value)) { if(new RegExp('^.{6,20}$').test(password.value)) { if(password.value === repassword.value) { return true; } else { alert('两次密码必须相同'); return false; } } else { alert("密码长度必须为6-20位"); return false; } } else { alert("账户必须为3-10位数字或字母"); return false; } }
Sign in to make a reply
卖杰克的豌豆
随便写写