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

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

WBOY
Release: 2016-05-16 17:56:48
Original
1283 people have browsed it

[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>
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template