I have a page that runs reloadData()
function every 5 seconds:
setTimeout('reloadData()', 5000);
I have an element that I'd like to update with a countdown from 5 to 0 for every second of the reloadData();
document.getElementById('countdown').value
What is the proper way to do achieve this effect?
Example:
reloadData() {}
starts- Element "
countdown
" will show: 5... 4... 3... 2... 1... (at second intervals) reloadData(){}
starts again