效果如下: 输入密码:
密码强度:
弱 | 中 | 强 |
复制代码 代码如下:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!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 runat="server">
<title>无标题页</title>
</head>
<mce:script language="javascript" type="text/javascript"><></mce:script>
复制代码 代码如下:
<body>
<form id="form1" runat="server">
<div>
输入密码:<asp:TextBox ID="TextBox1" runat="server" onKeyUp=pwStrength(this.value) onBlur=pwStrength(this.value) ></asp:TextBox><br />
密码强度:
<table border="1" cellpadding="1" borderColorDark="#fdfeff" borderColorLight="#99ccff" cellspacing="1">
<tr>
<td id="strength_L" align="center">
弱</td>
<td id="strength_M" align="center">
中</td>
<td id="strength_H" align="center">
强</td>
</tr>
</table>
</div>
</form>
</body>
</html>