<html>
<head>
<title>验证</title>
<script language = "JavaScript">
<!--
var i;
var string = prompt("请输入一个字符串!!","string");
function isAllChar(){
for(i = 0 ; i <string.length();i++ )
{
if(string.charAt(i)>='0' && string.charAt(i) <= '9')
{alert(string.charAt(i));
break;
}
}
if(i >=string.length())
{
document.write("你输入的是纯字符!!!");
}
else
document.write("你输入的字符串中含有数字!!");
}
isAllChar();
--></script>
</head>
<body>
</body>
</html>