When i use document.write it works, but it doesn't work with getElementById.
The same for while.
`

```
<div id="mydiv"></div>
    <script>
        var i = 0;
        for (i=0; i<=10; i++){
        //while (i<=10){
            document.getElementById("mydiv").innerHTML = i + "<br>";
            //i++;
        }
    </script>

```

Output is just 10, but I want to list 0-10 line by line. How to fix?