Hi I'm trying to display the iterations of a while loop continuously in a text box. However, the browser waits till the loop finishes then displays the final iteration only.
I'm using this loop to run a complex function which means the iterations will be slower and can be seen if displayed in the console:
For example, I'm trying to do something like this. in HTML:
<p>
<label>This is generation number</label>
<input type = "number"
id = "generation"
/>
</p>
in Javascript:
function Run(){
var i=0;
while (i<500) {
document.getElementById('generation').value= i;
i++
}
}