关于setInterval定时器的使用示例 博客分类: javascript JavaHTML
程序员文章站
2024-03-16 08:39:22
...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <body> <div id="dd"> <img src="ai2.gif" alt="" width="700" height="300" /> </div> <table> <tr align="left" valign="middle"> <td height="25"> <input type="radio" id="brandname" name="r" value="100" /> <input type="text" name="r" value="50" style="border:0 solid #000000"> </td> <td height="25"> 20 </td> </tr> <tr align="left" valign="middle"> <td height="25"> <input type="radio" id="brandname" name="r" value="200" /> <input type="text" name="r" value="250" style="border:0 solid #000000"> </td> <td height="25"> 220 </td> </tr> <tr align="left" valign="middle"> <td height="25"> <input type="radio" id="brandname" name="r" value="300" /> <input type="text" name="r" value="350" style="border:0 solid #000000"> </td> <td height="25"> 230 </td> </tr> </table> <script type="text/javascript"> var t; var ss=0; function setTimeOutss(){ ss+=1; if(ss>(17)){ document.getElementById("dd").display="none"; document.getElementById("dd").innerHTML=""; clearInterval(t); } } t=window.setInterval("setTimeOutss()",1000); </script> </body> </html>
上一篇: java:二分法