I'm encountering errors with a countdown script that I can't seem to resolve. The error message is generating 1 error every second:
Uncaught TypeError: Cannot set property 'textContent' of null
at (index):181
(anonymous) @ (index):181
setInterval (async)
(anonymous) @ (index):179
This is the code for the timer:
<script type="text/javascript">
var timeleft = 45;
var downloadTimer = setInterval(function(){
timeleft--;
document.getElementById("countdowntimer").textContent = timeleft;
document.getElementById("countdowntimer").style.color = "white";
if(timeleft <= 0)
clearInterval(downloadTimer);
},1000);
</script>