I want to write a loop that will display numbers from 1-100 in multiples that the user picks.
Here's my JS code.
var x = prompt("Enter the increment you want to see")
for (i=0;i<=100;i=i+x) {
document.write(i+"</br>")
}
For example, if I enter "10" I want the code to print the numbers 10, 20,30,40,50,60,70,80,90,100
Why does this not work?
I am teaching myself Javascript, and I am going crazy trying to figure this out.
Can anyone help?
document.write.