I am trying to set an Array to be the innerHTML of a div created by the script so show the array on ever step of the sort Function. I am getting

> 
> Cannot set property 'innerHTML' of null.
> 
> 
> 

arr is the name of the array.

Here is the code I am using:

```
function bubbleSort(arr){
    var swapped,
        container = document.getElementById("container"),
        o = 0;
    console.log("entered bubbleSort");
    do {
        swapped = false;
        for (var i=0; i < arr.length-1; i++) {
            console.log(arr);
            o + 1;
            container.innerHTML += '<div id = "div"+ o></div>';
            document.getElementById("div" + o).innerHTML = arr[i];
            if (arr[i] > arr[i+1]) {
                var temp = arr[i];
                arr[i] = arr[i+1];
                arr[i+1] = temp;
                swapped = true;
            }
        }
    } while (swapped)
}

```