I'm making a website that projects how many seconds left until Christmas. I made some of it, but I don't know a lot of javascript. It does work a little bit, but it just skips to zero and not one at a time. The thing is, I have no idea how to do it. I have searched and found about a function called setTimeout but when I use it, it just doesn't load and just crashes.
any help is needed
function counter(timeLeft) {
while (timeLeft > 0) {
timeLeft = timeLeft - 1;
$(document).ready(function() {
$(".time").text(timeLeft);
});
return;
}
}
counter(1500);