<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
<html xmlns="http://www.111cn.net/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312" />
<title>js 验证电话号码</title>
<script language="网页特效">
function validatetelephonenumber()
{
var telephonenumber = document.getelementbyid('t').value;
for (i = 0; i < telephonenumber.length; i++)
{
if (telephonenumber.charcodeat(i) > 96)
{
return false;
}
if (telephonenumber.charcodeat(i) < 32)
{
return false;
}
if (telephonenumber.charcodeat(i) > 64 && telephonenumber.charcodeat(i) < 91)
{
return false;
}
}
return true;
}
</script>
</head><body>
<input name="t" id="t"/> <input type="button" onclick="validatetelephonenumber();"
</body>
</html>