📌  相关文章
📜  重复倒数计时器javascript代码示例

📅  最后修改于: 2022-03-11 15:02:39.954000             🧑  作者: Mango

代码示例1
var count=25;

var counter=setInterval(timer, 1000); //1000 will  run it every 1 second

function timer()
{
  count=count-1;
  if (count <= 0)
  {
    clearInterval(counter);
    return;
   }

 document.getElementById("timer").innerHTML=count; // watch for spelling
 }