Created
January 7, 2021 05:09
-
-
Save Rameshwar-ghodke/66b90519bc964c3507f9afc1f8744532 to your computer and use it in GitHub Desktop.
Display number of count days , it will automatic reduce one by one days
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<span class="count_days" id='remain_days'> </span> | |
<script> | |
var countDownDate = new Date("Feb 15, 2021").getTime(); | |
var x = setInterval(function() { | |
var now = new Date().getTime(); | |
var distance = countDownDate - now; | |
var days = Math.floor(distance / (1000 * 60 * 60 * 24)); | |
document.getElementById("remain_days").innerHTML = days; | |
if (distance < 0) { | |
clearInterval(x); | |
document.getElementById("remain_days").innerHTML = "Update Soon.."; | |
} | |
}, 1000); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment