Complete password security verificationCodeIf there is a better person, I hope to reply to me:
<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML xmlns = "http://www.w3.org/1999/xhtml">
<Head>
<Title> password security verification </title>
<Script language = JavaScript>
Function hiddenlayer ()
{
Layer1.style. Visibility = "hidden ";
Layer2.style. Visibility = "hidden ";
Layer3.style. Visibility = "hidden ";
}
Function checkpasswordlevel (o ){
VaR n = 0;
If (/\ D/. Test (O. Value) n ++; // Contains numbers
If (/[A-Z]/. Test (O. Value) n ++; // Contains lowercase letters
If (/[A-Z]/. Test (O. Value) n ++; // Contains uppercase letters
If (/\ W/. Test (O. Value) n ++; // Contains other characters
If (O. value. Length <5) n = 1; // The length is less than 5 Characters
If (n = 1)
{
Layer1.style. Visibility = "visible ";
Layer2.style. Visibility = "hidden ";
Layer3.style. Visibility = "hidden ";
}
Else if (n = 2)
{
Layer1.style. Visibility = "hidden ";
Layer2.style. Visibility = "visible ";
Layer3.style. Visibility = "hidden ";
}
Else if (n> = 3)
{
Layer1.style. Visibility = "hidden ";
Layer2.style. Visibility = "hidden ";
Layer3.style. Visibility = "visible ";
}
}
</SCRIPT>
</Head>
<Body Onload = "hiddenlayer ()">
Password: <input id = "password1" type = "password" Onkeyup = "checkpasswordlevel (this )"/ > <Br/>
<Div id = "layer1" style = "Z-index: 101; left: 57px; width: 150px; position: absolute;
Top: 39px; Height: 20px; Background-color: # ff0000 ">
<Span style = "color: # ffffff"> <strong> & nbsp; insecure </strong> </span> </div>
<Div id = "Layer2" style = "Z-index: 102; left: 57px; width: 150px; position: absolute;
Top: 39px; Height: 20px; Background-color: # ffcc33 ">
<Span style = "color: # ffffff"> <strong> & nbsp; normal </strong> </span> </div>
<Div id = "layer3" style = "Z-index: 102; left: 57px; width: 150px; position: absolute;
Top: 39px; Height: 20px; Background-color: #006600 ">
<Span style = "color: # ffffff"> <strong> & nbsp; very Secure </strong> </span> </div>
</Body>
</Html>