NBartomeli
Programmer
I am trying to update a status message before/after function calls. My code looks like the following (simplified)
Can someone give me some advise as to why the span only updated for the last call. after i click the button the routines run and the "complete" message is displayed, why aren't the intermediate messages being drawn as well?
Thanks in advance
Code:
var status = document.getElementById('statusMessage');
function updateStatus(state){
status.innerText = state;
}
function doThings(){
updateStatus('doing something1');
doSomething1();
updateStatus('something1 done. doing something2');
doSomething2();
updateStatus('Complete.');
}
...
<input type="button" onclick="doThings();">
<span id="statusMessage"></span>
Can someone give me some advise as to why the span only updated for the last call. after i click the button the routines run and the "complete" message is displayed, why aren't the intermediate messages being drawn as well?
Thanks in advance