实例141.填空题测试.html

来自「JavaScript精彩网页特效实例精粹」· HTML 代码 · 共 50 行

HTML
50
字号
<script language="JavaScript"><!--score=100;mscored=25;var text="";function check1(){if(document.form1.u1.value != "华盛顿"){	text="第一题错误!\n"	score=score-mscored}if(document.form1.u2.value != "1949"){	text=text+"第二题错误!\n"	score=score-mscored}if(document.form1.u3.value != "欧"){	text=text+"第三题错误!\n"	score=score-mscored}if(document.form1.u4.value != "南美"){	text=text+"第四题错误!\n"	score=score-mscored	}if (text == "") {	alert("恭喜您,您全回答正确,得分100分!");}else{	alert(text);	alert("您的得分是"+score);}}//--></script></head><body><form name="form1" method="post">1、美国第一任总统是<input name="u1" type="text">。<br>2、中华人民共和国是<input name="u2" type="text">年成立的。<br>3、英国是<input name="u3" type="text">洲的国家。<br>4、阿根廷是<input name="u4" type="text">洲的国家。<br><input type="button" name="submit" value="提交" onclick="check1()"></form></body>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?