I have a problem that a for-loop executes its code just one time instead of the given number times.
If I put something thats not a number into the textfield I get the Error and console.log() shows me the number I put in the textbox.
It doesnt matter what code it would execute, I tried that aswell.
Code:
function Mehrere() {
var Anzahl = document.getElementById("Anzahl").value;
var AnzahlInt = parseInt(Anzahl);
console.log(AnzahlInt);
if (AnzahlInt > 0) {
for (i = 0; i < AnzahlInt; i++) {
Kreis();
}
} else {
alert("Error");
}
}
Thank you very much for your help :)