<input id="in1" value="1">
<input id="in2" value="5">
var text = "";
var t = document.querySelector("#in1").value;
var s = document.querySelector("#in2").value;
for (; t < s+1; t++) {
text += "List " + t + "<br>";
}
I got one problem and 1 question.
The problem :
when using +1
for the loop , the list generated is 1 to 50 instead of 1 to 5.
The question.
How to add 0 in front of 1 to 9 if <input id="in2" value="11">
Result:
List 01
List 02
List 03
List 04
List 05
List 06
List 07
List 08
List 09
List 10
List 11