Add Time & Date
This commit is contained in:
parent
47b884f8ef
commit
3826f09376
15
js/main.js
15
js/main.js
@ -1,4 +1,4 @@
|
||||
// Time
|
||||
// Countdown
|
||||
|
||||
const body = document.body;
|
||||
const endTime = new Date('9 13 2022 23:59:59');
|
||||
@ -22,11 +22,14 @@ function updateCountdown() {
|
||||
secondsEl.innerHTML = seconds < 10 ? '0'+seconds : seconds;
|
||||
}
|
||||
|
||||
// Data
|
||||
const time = new Date();
|
||||
document.getElementById("date").innerHTML = time;
|
||||
// scroll To Top
|
||||
|
||||
// Time & Date
|
||||
setInterval(function(){
|
||||
document.getElementById('date').innerHTML = Date();
|
||||
},1000);
|
||||
|
||||
|
||||
// scroll To Top
|
||||
let scrollTop = document.querySelector('.scrollTop');
|
||||
|
||||
window.onscroll = function (){
|
||||
@ -37,4 +40,4 @@ scrollTop.onclick = function(){
|
||||
top: 0,
|
||||
behavior:'smooth'
|
||||
});
|
||||
};
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user