Home >Web Front-end >JS Tutorial >Example of using JS to count seconds_javascript skills

Example of using JS to count seconds_javascript skills

WBOY
WBOYOriginal
2016-05-16 17:22:011227browse
Copy code The code is as follows:

var i = 5;
function init(){
//Get control of the object
var span1 = document.getElementById("span1");
//Modify its properties
span1.innerHTML = i;
i--;
//Timing operations: window.setTimeout('',1000) window.setInterval();
window.setTimeout('init()', 1000);
}
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