标签:
<script type="text/javascript"> var n=1; function start() { timename=setInterval("set()",1000); } function set(){ document.getElementsByTagName("p")[0].innerHTML =n++; if(n==11){ clearInterval(timename); } } </script> </head> <body onload=setTimeout()> <p></p> </body>
public class XX { public static void main(String[] args) throws InterruptedException { for (int i = 1; i <= 10; i++) { System.out.println(i); Thread.sleep(1000); } } }
6.用java和javascript写一个程序,每秒打印一个数字,打印出1-10
标签:
原文地址:http://www.cnblogs.com/xiaotaoxu/p/5540579.html