<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>+ &nbsp;</b></font>
  <input type="text" readonly name="text2" size=1 style="border: 0 solid #FFFFFF" class=1>
  <font size=7 color=#FF0000><b>= &nbsp;</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>

解决方案 »

  1.   

    <html>
    <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>
      

  2.   

    to dugucan:
    看什么不就行了。