<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>setInterval()和setTimeout()参考代码-www.jb200.com</title>
<script type="text/
javascript">
setTimeout(txt,1000);
function txt(){
document.body.innerHTML = "<font color=red> OK " + parseInt(Math.random()*1000)+1 + "</font> ";
setTimeout(txt,1000);
}
//setInterval("txt()",1000); //用这个的话每间隔3000毫秒执行一次
//setTimeout(txt,3000); //用这个的话执行一次就不执行了
</script>
</head>
<body>
</body>
</html>