-
Notifications
You must be signed in to change notification settings - Fork 0
/
script13.js
18 lines (17 loc) · 873 Bytes
/
script13.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
var countDownDate = new Date("July 31, 2024 23:59:59").getTime();
var countdownfunction = setInterval(function () {
var now = new Date().getTime();
var distance = countDownDate - now;
var days = Math.floor(distance / (1000 * 60 * 60 * 24));
var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
var seconds = Math.floor((distance % (1000 * 60)) / 1000);
document.querySelector(".days").innerHTML = days;
document.querySelector(".hours").innerHTML = hours;
document.querySelector(".minutes").innerHTML = minutes;
document.querySelector(".seconds").innerHTML = seconds;
if (distance < 0) {
clearInterval(countdownfunction);
document.querySelector(".countdown").innerHTML = "EXPIRED";
}
}, 1000);