Hello. my html doesn t read my java script file. Can you help me or is problem with my program or computer.
my file:
html:
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Countdown timer</title>
<link rel="stylesheet" href="style.css">
<script src="../JS2/script.js"></script>
>
<h1>Hello poppers</h1>
<div class="countdown-container">
<div class="countwdown-el days-c" >
<p class="big-text" id="days">0</p>
<span>days</span>
</div>
<div class="countwdown-el hours-c" >
<p class="big-text" id="hours">0</p>
<span>hours</span>
</div>
<div class="countwdown-el min-c" >
<p class="big-text" id="mins">0</p>
<span>mins</span>
</div>
<div class="countwdown-el seconds-c" >
<p class="big-text" id="seconds">0</p>
<span>seconds</span>
</div>
</div>
</body>
</html>
my script javascript:
const daysEl = document.getElementById ('days');
const hoursEl = document.getElementById ('hours');
const minsEl = document.getElementById ('mins');
const secondsEl = document.getElementById ('seconds');
const newYears='1 Jan 2022';
function countDown(){
const newYearsDate = new Date(newYears);
const currentDate = new Date();
const totalSeconds = (newYearsDate-currentDate) / 1000;
const days = Math.floor(seconds / 3600 / 24);
const hours = Math.floor(totalSeconds / 3600) % 24 ;
const mins = Math.floor(totalSeconds / 60) % 60;
const seconds = Math.floor(totalSeconds) % 60;
daysEl.innerHTML = days;
hoursEl.innerHTML =hours;
minsEl.innerHTML = mins;
secondsEl.innerHTML = seconds;
}