码迷,mamicode.com
首页 > 其他好文 > 详细

代码制作速度与准确性的训练

时间:2014-09-10 12:09:20      阅读:164      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   color   io   java   ar   for   art   

<!--要完成此效果把如下代码加入到<body>区域中-->
<SCRIPT LANGUAGE="JavaScript">
<!-- Original:  Tomer Shiran
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Begin
var total = 0
var play = false
function display(element) {
var now = new Date()
if (!play) {
play = true
startTime = now.getTime()}
if (now.getTime() - startTime > 20000) {
element.checked = !element.checked
return
}
if (element.checked)
total++
else
total--
element.form.num.value = total
}
function restart(form) {
total = 0
play = false
for (var i = 1; i <= 100; ++i) {
form.elements[i].checked = false
}
}
// End -->
</SCRIPT>
<!--要完成此效果把如下代码加入到<body>区域中石家庄花卉租赁-->
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
document.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>

 

代码制作速度与准确性的训练

标签:style   blog   http   color   io   java   ar   for   art   

原文地址:http://www.cnblogs.com/youtianxia/p/3963956.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!