I am an absolute javascript layman.
I made a simple for loop and wanted to output the value of i in a div.
Unfortunately, only the last value is displayed.
But why does console.log (i) show me every value of i in the console?
for (i = 0; i < 10; i++) {
let myBlock = document.getElementById('myblock');
console.log(i)
myBlock.innerHTML = i;
}
<div id="myblock"/>