I would like this countdown to start at 10 then count down to 1, but for the user to see it in real time - this script waits 50 seconds and then shows me all the numbers (1-10). What am I doing wrong here?
<body>
Countdown<br><br>
<div id="countdown">
<?php
for($i = 10; $i >= 1; $i--) {
echo $i;
sleep(5);
};
?>
</div>
<script>
setTimeout((document.getElementById('countdown').reload()),1000);
</script>
</body>
I tried the above example