<html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style>.1{font-size: 24px;font-family:Arial Black}</style></head>
<body bgcolor="#FFFFFF" text="#000000" >
<form name="form1" method="post" action="">
<input type="text" readonly name="text1" size=1 style="border: 0 solid #FFFFFF" class=1>
<font size=7 color=#FF0000><b>+ </b></font>
<input type="text" readonly name="text2" size=1 style="border: 0 solid #FFFFFF" class=1>
<font size=7 color=#FF0000><b>= </b></font>
<INPUT type="text" name="text3" onkeydown="if(event.keyCode==13)cc()" size=2 class=1>
<input type="button" name="but" value="开始" onClick="sss()" class=1><br>
<textarea name="text4" rows="4" cols="40"></textarea><br>
<input type="text" name="text5" size="47">
</form></body><script language=javascript>
var n=0;var m=0;
function cc()
{
if(parseInt(form1.text1.value) + parseInt(form1.text2.value)!= parseInt(form1.text3.value))
{alert("对不起,你答错了!");m+=1;document.form1.text3.value="";return;}
var aa = document.all.text4.value; n = n + 1;
var ss = n+". "+form1.text1.value+"+"+form1.text2.value+"="+form1.text3.value
document.form1.text4.value =(aa=="") ? ss : aa+"\r\n"+ss;
document.form1.text5.value = "你总共答了 "+n+" 道题!";
if (m>0)document.form1.text5.value+="共答错了 "+m+" 次!"
sss();
}
function sss()
{
var s1=Math.round(Math.random()*(20-1)+1);
var s2=Math.round(Math.random()*(20-1)+1);
document.form1.text1.value=s1;
document.form1.text2.value=s2;
document.form1.text3.value="";
form1.text3.focus();
}
</script>
</html>
<style>.1{font-size: 24px;font-family:Arial Black}</style></head>
<body bgcolor="#FFFFFF" text="#000000" >
<form name="form1" method="post" action="">
<input type="text" readonly name="text1" size=1 style="border: 0 solid #FFFFFF" class=1>
<font size=7 color=#FF0000><b>+ </b></font>
<input type="text" readonly name="text2" size=1 style="border: 0 solid #FFFFFF" class=1>
<font size=7 color=#FF0000><b>= </b></font>
<INPUT type="text" name="text3" onkeydown="if(event.keyCode==13)cc()" size=2 class=1>
<input type="button" name="but" value="开始" onClick="sss()" class=1><br>
<textarea name="text4" rows="4" cols="40"></textarea><br>
<input type="text" name="text5" size="47">
</form></body><script language=javascript>
var n=0;var m=0;
function cc()
{
if(parseInt(form1.text1.value) + parseInt(form1.text2.value)!= parseInt(form1.text3.value))
{alert("对不起,你答错了!");m+=1;document.form1.text3.value="";return;}
var aa = document.all.text4.value; n = n + 1;
var ss = n+". "+form1.text1.value+"+"+form1.text2.value+"="+form1.text3.value
document.form1.text4.value =(aa=="") ? ss : aa+"\r\n"+ss;
document.form1.text5.value = "你总共答了 "+n+" 道题!";
if (m>0)document.form1.text5.value+="共答错了 "+m+" 次!"
sss();
}
function sss()
{
var s1=Math.round(Math.random()*(20-1)+1);
var s2=Math.round(Math.random()*(20-1)+1);
document.form1.text1.value=s1;
document.form1.text2.value=s2;
document.form1.text3.value="";
form1.text3.focus();
}
</script>
</html>
解决方案 »
- ext panel居中
- 仿门户网站头部的伸缩广告
- js如何求上月月份?
- 询问(30):在jsp,web开发中,一般用什么方法(or技术,框架。。。)实现文件下载?
- 缺少对象错误,高手进来抠分!
- 对js中动态增加的text框的内容如何判断?
- 100在线结贴!设计一个按钮,按下去后按钮的字体变红色。我设计的函数哪里出问题了?如何修改?
- 问一个简单的问题?cookies是否一定要服务器为客户设置?能否用户自己用javascript在自己的浏览器(不通过服务器端)设置cookies?
- 我既不想让它弹出对话框,也不想打印到默认打印机上,有什么办法吗?
- jquery怎么获取一个节点相对于祖先节点的偏移量?
- IE与Netscape的兼容性 (送100分)
- 在dw中如何设置一个单元格的边框为虚线呀
<head>
</head><body><form name="form1">
<input type="text" name=t1 size=5 readonly style="border:0 solid #ffffff" class=1>+
<input type="text" name=t2 size=5 readonly style="border:0 solid #ffffff" class=1>=
<input type=text name=t3 size=5 onkeydown="if(event.keyCode==13)show()">
<textarea name=t4 rows=4 cols=20></textarea>
<input type=text name=t5 size=100> <br>
<input type=button value=gogogo onclick=go()>
</form>
<script>
n=0
m=0
function show(){
var first=eval(form1.t1.value)
var second=eval(form1.t2.value)
var add=eval(form1.t1.value)+eval(form1.t2.value)
if(first+second!=add){
alert("you are wrong!")
n+=1
document.form1.t3.value=""
if(n>1){
document.form1.t5.value="you are wrong"+n+"times"
}}
else{
m+=1
document.form1.t3.value=""
document.form1.t4.value+=m+"."+first+"+"+second+"="+add+"\r\n"
document.form1.t5.value="you are right"+m+"times"
}
go();
}
function go(){
document.form1.t1.value=Math.round(Math.random()*(20-1)+1);
document.form1.t2.value=Math.round(Math.random()*(20-1)+1);}
</script></body>
</html>
看什么不就行了。