The example of this article tells the countdown program based on JS implementation. Share to everyone for your reference. The implementation methods are as follows:
Time Remaining: <i id= "Expiretime" ></i>
<script type= "Text/javascript" >
var expire = 2412169;
var expiretime = function (expires) {
if (expires > 0) {
var second = expires;
} else{
var second = "0 points";
return second;
}
var day = hour = min = "";
if (second>86400) {
day = Math.floor (second/86400) + "days";
second = second%86400;
}
if (second>3600) {
hour = Math.floor (second/3600) + "when";
second = second%3600;
}
if (second>60) {
min = Math.floor (second/60) + "min";
second = second%60;
}
Second = second+ "seconds";
return day+hour+min+second;
}
var Timeele = document.getElementById ("Expiretime");
var timer = Window.setinterval (function () {
timeele.innerhtml = Expiretime (expire--);
if (expire<0) {
clearinterval (timer);
}
},1000);
</script>
The
wants this article to help you with your JavaScript programming.