Home  >  Article  >  Web Front-end  >  Javascript countdown (timing) code to execute jump event_time and date

Javascript countdown (timing) code to execute jump event_time and date

WBOY
WBOYOriginal
2016-05-16 17:56:481270browse

[Ctrl A select all Note: If you need to introduce external Js, you need to refresh to execute
]<script> document.getElementByIdx_x=function(id){ if(typeof id =='string') return document.getElementById(id); else throw new error('please pass a string as a id!') } var timer = window.setInterval(function(){ document.getElementByIdx_x('box').innerHTML = parseInt(document.getElementByIdx_x('box').innerHTML) - 1; if(parseInt(document.getElementByIdx_x('box').innerHTML) < 0) { window.clearInterval(timer); window.location = 'http://www.jb51.net'; } }, 1000); </script>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn