I would like to print some array values to the screen inside a container div. The loop below is only printing the final array value "dog" to the screen.
I can't seem to work out the problem here?
JS
var arr = ["mouse", "cat", "dog"];
var holder = document.getElementById("holder");
for ( var i=0; i < arr.length; i+=1 ) {
holder.innerHTML = "<p>" + arr[i] + "</p><br/>" ;
}
HTML
<div id="holder"></div>
+=not=) at the moment your overwriting it.