var id = 1;
function myClick(){
  document.getElementById('c'+id).click();
  id++;
  if(id<5){    
    setTimeout(myClick(),5000)
  }
}

解决方案 »

  1.   

    用setInterval+计数器就可以了!L@_@K
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title> new document </title>
        <meta name="generator" content="editplus" />
        <meta name="author" content="Gao YiXiang" />
        <meta name="email" content="[email protected]" />
        <meta name="keywords" content="javascript dhtml dom" />
        <meta name="description" content="I love web development." />
    </head>
    <body><script type="text/javascript">
    <!--
    for (i=1; i<=7; i++)

        document.write("<input id='c"+i+"' type='button' onclick=\"alert('Button C"+i+"\');\" value=C"+i+">\n"); 

    //-->
    </script><input type="button" value="ShowI" id="btnShow" /><script type="text/javascript">
    <!--var iInterval = 5000;
    var iEnd = 5;
    var iCount = 0;
    var iTimerID = null;
    document.getElementById("btnShow").onclick = function()
    {
        iTimerID = setInterval(show, iInterval);
    };function show()
    {
        iCount++;
        document.getElementById('c'+iCount).click();
        if (iCount == iEnd)
        {
            clearInterval(iTimerID);
        }
    }//-->
    </script></body>
    </html>
      

  2.   

    送你三本手册!DHTML参考手册
    http://download.csdn.net/source/308913样式表中文手册
    http://download.csdn.net/source/304124JScript语言参考
    http://download.csdn.net/source/308916
      

  3.   

    按照你的思路:<Script   Language=JavaScript> var count=2;
    function doit() {
         document.getElementById('c1').click();
         var Process = setInterval(function () {
               document.getElementById('c'+count).click();
               count++;
               if (count>5) clearInterval(Process);
         },5000);
    }
    for   (i=1;i<=5;i++)
           document.write("<input id=\"c"+i+"\" type=\"button\" onclick=\"alert(\'Button C"+i+"\');\"   value=\"C"+i+"\"\/>\r\n"); document.write("<input type=\"button\" value=\"ShowI\" onclick=\"doit()\"\/>");</Script> 
    其实这段代码已经是低效率了
    很简单的东西。你没找对思路。
      

  4.   

    谢谢楼上几位的帮助...特别是# jiewenxu的做法让我茅塞顿开...
    以前只想到用setTimeout,执行一次之后要自己再加循环...
    一直没想到用setInterval直接去循环,,太感谢了....我正在摸索那个打分方法~~~~谁能告诉我一下悬赏的分是咋样打出去的.....-____-!!
    小弟是在太菜了...不好意思....