Countdown timer?

前端 未结 4 994
暗喜
暗喜 2021-01-03 05:21

How do you make a Countdown timer?

When the user loads the page, clock starts counting down, it reaches time, it redirects browser to a new page.

Found this,

4条回答
  •  离开以前
    2021-01-03 05:22

    with pure javascript you could do it like this

    window.onload=function(){ // makes sure the dom is ready
      setTimeout('function(){document.location = "http://www.google.com"}', 10000) // redirects you to google after 10 seconds
    }
    

提交回复
热议问题