我刚学Javascript,按书上写脚本的,但不能执行,帮我看一下

来源:百度知道 编辑:UC知道 时间:2024/05/13 04:22:49
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<script language="JavaScript">
function checkData()
{
if (document.form1.three.value.length==3)
alert("OK!有效!");
else
{
alert("请输入三个字符,"+document.form1.three.value+"无效!");
returm false
}
}
</script>
<form name="form1">
<center>
请输入字符:<input type="text"name="three"onChange="checkData()">
</center>
</form>
</body>
</html>
为什么说行数21却少对像

returm false 拼错了
return

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<script language="JavaScript">
function checkData()
{
if (document.form1.three.value.length==3)
alert("OK!有效!");
else
{
alert("请输入三个字符,"+document.form1.three.value+"无效!");
return false
}
}
</script>
<form name="form1" onSubmit="return checkData()">
请输入字符:<input type="text" name="three" >
<input type="submit" >
</form>
</body>
</html>