绿茶冲泡时间:请求大家帮检查一个简单的javascript程序错误

来源:百度文库 编辑:中科新闻网 时间:2024/05/16 08:01:02
<html>
<head>
<title>java script的综合练习
</title>

<scrip language="javascrip">
function submitNo1(){
var txtName;
var txtPass;
txtName = txtname.value.length;
txtPass = txtps.value.length;
if(txtName == 0){
alert("用户名不能为空!");
txtname.focus();
}else if(txtPass == 0){
alert("密码不能为空!");
txtps.focus();
}
}

</scrip>

</head>
<body bgcolor="black">
<h3 align="center"><font color="red"><u>
Java Script的综合练习</u></font></h3>
<hr color="red">

          
          
          

<font color="red" size="3">用户名:</font>
<input type="text" name="txtname" value="">
<br>

          
          
          

<font color="red" size="3">密  码:</font>
<input type="password" name="txtps" value="">
<br>

          
          
          
         

<input type="submit" name="sub" value="确定" onclick="submitNo1()">

    

<input type="reset" name="re" value="取消">
<hr color="red">
</body>
</html>

这里错了<script language="javascrip">
少些了t
<script language="javascript">

还有结束的
</scrip>也要改为</script>