按照老师敲的怎么没有效果 大神们求赐教
<!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>
<meta http-equiv="Content-Type" content="text/html; charset="utf-8">
<link rel="stylesheet" href="css/biaodan.css" type="text/css" />
<script type="text/javascript" src="js/biaodan.js"></script>
</head>
<body>
<form>
<!--会员名-->
<div>
<label>
<span>会员名:</span>
<input type="text" class="text" />
</label>
<p class="msg">
<i></i>
5-25个字符,一个汉字为两个字符,推荐使用中文会员名
</p>
</div>
<div>
<label>
<span></span>
<b id="count">0个字符</b>
</label>
</div>
<!--密码-->
<div>
<label>
<span>登陆密码:</span>
<input type="password" class="text" />
</label>
<p class="msg">
<i></i>
5-25个字符,一个汉字为两个字符,推荐使用中文会员名
</p>
</div>
<div style="margin:3px 0 10px 0">
<label>
<span></span>
<em class="active">弱</em>
<em>中</em>
<em>强</em>
</label>
</div>
<!--确认密码-->
<div style="padding-bottom:20px">
<label>
<span>确认密码:</span>
<input type="password" class="text disabled=" />
</label>
<p class="msg">
<i></i>
请再输一次
</p>
</div>
<!--验证码-->
<div>
<label>
<span>验证码:</span>
<input type="text" class="text" style="width:50px" />
<img class="ver_img" src="../../img/verification_code.png">
<a class="changeimg" href="#" title="重新获取验证码"></a>
</label>
</div>
<!--提交按钮-->
<div>
<input class="submitBtn btn" type="submit" value="同意协议并注册">
</div>
</form>
</body>
</html>
//js
function getLength(str)
{
return str.replace(/[^\x00-xff]/g,"xx").length;
}
window.onload=function()
{
var aInput=document.getElementsByTagName('input');
var oName=aInput[0];
var aP=document.getElementsByTagName('p');
var name_msg=aP[0];
var count=document.getElementById('count');
var name_length=0;
var re=/[^\w\u4e00-\u9fa5]/g;
oName.onfocus=function()
{
name_msg.style.dispaly="block";
name_msg.innerHTML='<i class="ati"></i> 5-25字符 一个汉字两个字符';
};
oName.onkeyup=function()
{
count.style.visibility="visible";
name_length=getLength(this.value);
count.innerHTML=name_length+"个字符";
if(name_length==0)
{count.style.visibility="hidden";}
};
oName.onblur=function()
{
var re=/[^\w\u4e00-\u9fa5]/g;
if(re.test(this.value))
{name_msg.innerHTML='<i class="err"></i>非法';}
else if(this.value=="")
{name_msg.innerHTML='不能为空'}
else if(name_length>25)
{name_msg.innerHTML='too long!';}
else if(name_length<6)
{name_msg.innerHTML='too short!';}
else
{name_msg.innerHTML='<i class="ok"></i>OK';}
}
}