问个关于脚本的问题?
脚本是:
<script language= "javascript " type= "text/javascript ">
function test()
{
var nameElement=document.getElementById( "userBox ");
var name=nameElement.value;
var pwdElement=document.getElementById( "pwdBox ");
var pwd=pwdElement.value;
var ageElement=document.getElementById( "ageBox ");
var age=ageElement.value;
var cityElement=document.getElementById( "cityBox ");
var city=cityElement.Value;
var emailElement=document.getElementById( "emailBox ");
var email=emailElement.value;
if (name.length > 12 || name.length < 6)
{
window.alert( "用户名长度不正确,请确定长度为6-12位! ");
nameElement.value= " ";
nameElement.focus();
return false;
}
else if (pwd.length > 12 || pwd.length < 6)
{
window.alert( "密码长度不正确,请确定长度为6-12位! ")
pwdElement.value= " ";
pwdElement.focus();
return false;
}
else if (age < 150 && age > 1)
{
if (city