I'm trying to print the same repetitive piece of text over and over (\I[0]
), but with the number inside it incrementing by 1 each time (ex: \I[0] \I[1] \I[2]
etc). I've figured that out already.
But what I want to do is make it so every time the piece of text is printed 15 times, it will add a line break.
EX: Prints 0 - 14. Then, puts in a <br>
tag, and keeps printing, until it reaches 29. Then, adds another <br>
tag. Etc. until it reaches the number 527.
HTML:
<p id="number"></p>
Javascript:
var text = "";
var i;
for (i = 0; i < 528; i++) {
text += "\\I[" + i + "] ";
}
document.getElementById("number").innerHTML = text;
Any ideas? Thank you.