我的htm源码怎么总是显示有错误
<html><head><title>网页特效|Linkweb.cn/Js|---测试心算能力</title><styletype="text/css"><!--body...
<html>
<head>
<title>网页特效|Linkweb.cn/Js|---测试心算能力</title>
<style type="text/css">
<!--
body { font-family: "宋体"; font-size: 9pt; margin-top: 0px; margin-left: 0px; margin-right: 0px}
A { COLOR: black; FONT-SIZE: 13px; FONT-WEIGHT: 400; TEXT-DECORATION: none }
A:hover { COLOR: red; FONT-SIZE: 13px; FONT-WEIGHT: 400; TEXT-DECORATION: underline }
a:active { font: 9pt "宋体"; cursor: hand; color: #FF0033 }
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<br>
<br>
<center><font color=red face="隶书" size=6>测试心算能力</font></center>
<br>
<br><center>
<table border=0 bordercolor=blue borderlight=green style="border-collapse: collapse" cellpadding="0" cellspacing="0">
<tr><td align=center><font size=4 color=red face="Arial, Helvetica, sans-serif"><strong>下面框中为脚本显示区
</strong></font></td></tr>
<tr><td align=center><SCRIPT LANGUAGE="JavaScript"><!--
function es() {
alert("请先作好准备.注意初始值为0")
x=0
var today=new Date()
sec=0
for (i=1;i<=5;i++) {
sec=today.getSeconds()
rand1 = 31
while ( rand1 > 30 ) {
rand1 = Math.random()*sec*100
rand1 = Math.ceil(rand1)
}
rand2 = Math.random()
if (rand2>0.5) {
mes="加上 ";
mes1=" 到 ";
y=rand1
}
else{
mes=" 减去 " ;
mes1=" 从 ";
y=-rand1
}
x1=x
x=x+y
if (x<0) {
mes="加上 ";
mes1=" 到 ";
x=x1+rand1
}
alert("请把原来结果"+mes+rand1+mes1+". ")
}
alert("请在下面的框上回答!")
}
//-->
</SCRIPT>
<FORM NAME="f"><INPUT TYPE="button" VALUE="开始啦" onClick="es()">
<SCRIPT LANGUAGE="JavaScript">
function KK(){
tst=document.dd.username.value;
if (tst!=x)
alert("你答错了。正确答案是 "+x+" ")
}
else
{alert("恭喜你,答对了")
}
}
</SCRIPT>
<FORM NAME="dd">
<INPUT TYPE="text" NAME="username" VALUE="" SIZE=10>
<INPUT TYPE="button" VALUE="回答" onClick="kk()"></FORM>
一个简单的htm源码.只是不明白为什么会错.高手帮忙看看.我是想做一个随即心算的程序.
还有想问一下.好象有个语句是 **box什么类似的.弹出一个像alert的窗口,可以在里面添东西.这语句是什么了?我忘了! 展开
<head>
<title>网页特效|Linkweb.cn/Js|---测试心算能力</title>
<style type="text/css">
<!--
body { font-family: "宋体"; font-size: 9pt; margin-top: 0px; margin-left: 0px; margin-right: 0px}
A { COLOR: black; FONT-SIZE: 13px; FONT-WEIGHT: 400; TEXT-DECORATION: none }
A:hover { COLOR: red; FONT-SIZE: 13px; FONT-WEIGHT: 400; TEXT-DECORATION: underline }
a:active { font: 9pt "宋体"; cursor: hand; color: #FF0033 }
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<br>
<br>
<center><font color=red face="隶书" size=6>测试心算能力</font></center>
<br>
<br><center>
<table border=0 bordercolor=blue borderlight=green style="border-collapse: collapse" cellpadding="0" cellspacing="0">
<tr><td align=center><font size=4 color=red face="Arial, Helvetica, sans-serif"><strong>下面框中为脚本显示区
</strong></font></td></tr>
<tr><td align=center><SCRIPT LANGUAGE="JavaScript"><!--
function es() {
alert("请先作好准备.注意初始值为0")
x=0
var today=new Date()
sec=0
for (i=1;i<=5;i++) {
sec=today.getSeconds()
rand1 = 31
while ( rand1 > 30 ) {
rand1 = Math.random()*sec*100
rand1 = Math.ceil(rand1)
}
rand2 = Math.random()
if (rand2>0.5) {
mes="加上 ";
mes1=" 到 ";
y=rand1
}
else{
mes=" 减去 " ;
mes1=" 从 ";
y=-rand1
}
x1=x
x=x+y
if (x<0) {
mes="加上 ";
mes1=" 到 ";
x=x1+rand1
}
alert("请把原来结果"+mes+rand1+mes1+". ")
}
alert("请在下面的框上回答!")
}
//-->
</SCRIPT>
<FORM NAME="f"><INPUT TYPE="button" VALUE="开始啦" onClick="es()">
<SCRIPT LANGUAGE="JavaScript">
function KK(){
tst=document.dd.username.value;
if (tst!=x)
alert("你答错了。正确答案是 "+x+" ")
}
else
{alert("恭喜你,答对了")
}
}
</SCRIPT>
<FORM NAME="dd">
<INPUT TYPE="text" NAME="username" VALUE="" SIZE=10>
<INPUT TYPE="button" VALUE="回答" onClick="kk()"></FORM>
一个简单的htm源码.只是不明白为什么会错.高手帮忙看看.我是想做一个随即心算的程序.
还有想问一下.好象有个语句是 **box什么类似的.弹出一个像alert的窗口,可以在里面添东西.这语句是什么了?我忘了! 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询