Chinaunix首页 | 论坛 | 博客
  • 博客访问: 16502957
  • 博文数量: 5645
  • 博客积分: 9880
  • 博客等级: 中将
  • 技术积分: 68081
  • 用 户 组: 普通用户
  • 注册时间: 2008-04-28 13:35
文章分类

全部博文(5645)

文章存档

2008年(5645)

我的朋友

分类:

2008-04-28 21:14:45

下载本文示例代码
脚本说明:第一步:把如下代码加入<head>区域中<SCRIPT LANGUAGE="JavaScript"><!-- Original: Tomer Shiran<!-- This script and many more are available free online at --><!-- The JavaScript Source!! --><!-- Beginvar total = 0var play = falsefunction display(element) {var now = new Date()if (!play) {play = truestartTime = now.getTime()}if (now.getTime() - startTime > 20000) {element.checked = !element.checkedreturn} if (element.checked)total elsetotal--element.form.num.value = total}function restart(form) {total = 0play = falsefor (var i = 1; i <= 100; i) { form.elements[i].checked = false }}// End --></SCRIPT>第二步:把如下代码加入<body>区<CENTER>Test your skill. How many boxes can you check in 20 seconds?</CENTER><SCRIPT LANGUAGE="JavaScript"><!-- Begindocument.write("<FORM><CENTER>")document.write('<INPUT TYPE="text" VALUE="0" ');document.write('NAME="num" SIZE=10 onFocus="this.blur()"><BR>')document.write("<HR SIZE=1 WIDTH=40%>")for (var i = 0; i < 10; i) {for (var j = 0; j < 10; j) {document.write('<INPUT TYPE="checkbox" ');document.write('onClick="display(this)">')}document.write("<BR>")}document.write("<HR SIZE=1 WIDTH=40%>")document.write('<INPUT TYPE="button" VALUE="restart" ');document.write('onClick="restart(this.form)">')document.write("</CENTER></FORM>")// End --></SCRIPT> 脚本说明:第一步:把如下代码加入<head>区域中<SCRIPT LANGUAGE="JavaScript"><!-- Original: Tomer Shiran<!-- This script and many more are available free online at --><!-- The JavaScript Source!! --><!-- Beginvar total = 0var play = falsefunction display(element) {var now = new Date()if (!play) {play = truestartTime = now.getTime()}if (now.getTime() - startTime > 20000) {element.checked = !element.checkedreturn} if (element.checked)total elsetotal--element.form.num.value = total}function restart(form) {total = 0play = falsefor (var i = 1; i <= 100; i) { form.elements[i].checked = false }}// End --></SCRIPT>第二步:把如下代码加入<body>区<CENTER>Test your skill. How many boxes can you check in 20 seconds?</CENTER><SCRIPT LANGUAGE="JavaScript"><!-- Begindocument.write("<FORM><CENTER>")document.write('<INPUT TYPE="text" VALUE="0" ');document.write('NAME="num" SIZE=10 onFocus="this.blur()"><BR>')document.write("<HR SIZE=1 WIDTH=40%>")for (var i = 0; i < 10; i) {for (var j = 0; j < 10; j) {document.write('<INPUT TYPE="checkbox" ');document.write('onClick="display(this)">')}document.write("<BR>")}document.write("<HR SIZE=1 WIDTH=40%>")document.write('<INPUT TYPE="button" VALUE="restart" ');document.write('onClick="restart(this.form)">')document.write("</CENTER></FORM>")// End --></SCRIPT> 下载本文示例代码


测试点击速度测试点击速度测试点击速度测试点击速度测试点击速度测试点击速度测试点击速度测试点击速度测试点击速度测试点击速度测试点击速度测试点击速度测试点击速度测试点击速度测试点击速度
阅读(88) | 评论(0) | 转发(0) |
0

上一篇:动脑小游戏

下一篇:模拟跳舞游戏

给主人留下些什么吧!~~