for (var i=1;i<5;i--) {
...
}
This is an infinite loop, not good.
Create a div that takes up the whole page with CSS and give it an overflow-wrap property of break-word
<head>
<style>
#numbers{
width: 100%;
height: 900px;
background-color: #aeaeae;
overflow-wrap: break-word;
}
</style>
</head>
<div id="numbers"></div>
Then write a simple loop that adds each new random number to the end of the string enough times to fill the page, but not infinitely.
var filler = "";
for(i=0;i<3500;i++){
var num = Math.floor(Math.random() * 9) + 1;
filler += num;
}
document.getElementById("numbers").innerHTML = filler;
https://jsfiddle.net/4qwercqu/