标签:随机 nbsp inter func value fun ffffff color onclick
1 <html> 2 <head> 3 <title>背景随机变色</title> 4 <script type="text/javascript"> 5 var timmerID; 6 function color(){ 7 document.bgColor="#"+Math.random()*0xffffff; 8 } 9 function start(){ 10 timmerID=window.setInterval("color()",100); 11 } 12 function stop(){ 13 window.clearInterval(timmerID); 14 } 15 16 17 </script> 18 19 </head> 20 <body> 21 <input type="button" value="启动" onclick="start()" /> 22 <input type="button" value="停止" onclick="stop()" /> 23 24 25 </body> 26 </html>
标签:随机 nbsp inter func value fun ffffff color onclick
原文地址:http://www.cnblogs.com/liuyangv/p/7989558.html