简单密码强度校验
function pwdStrength(str){var chars = 0,power = 0;var Level = ['密码强度太弱','密码强度中','密码强度高']if(!str || str.length < 6){return Level[0];}if((/[a-z]/).test(str)){chars += str.length;power = 1;} if((/[A-Z]/).test(str)){chars += str.length;power += 1;} if((/[0-9]/).test(str)){chars += str.length;power += 1;} if((/[^a-zA-Z0-9]/).test(str)){chars += str.length*2;power += 1;} if( power > 2 ){return Level[2];}else if(power === 2){if(chars > 10){return Level[2];}else{return Level[1]}}else{if(chars > 20){return Level[1];}else{return Level[0];}}}