Hallo!
Mich beschäftigt folgendes Phänomen:
countgold=parseInt(document.daten.gold.value); //Formularfeld
benotgold=parseInt(document.Objekte.elements[m+1].value); //Formularfeld
alert(typeof benotgold+"x"+typeof countgold+"x"+(benotgold-countgold));
die beiden variabeln countgold und benotgold stellen formularfelder da.
Ich habe gültige Zahlen für sie eingesetzt!
So, mit der 3. Zeile überprüfe ich jetzt den Typ der Variablen
benotgold ist number
countgold ist number
benotgold minus countgold ist NaN ???
irgendwie verstehe ich nicht, was da passiert ist. Er sagt mir doch eindeutig, das beide Werte number sind, aber wieso kann er sie dann nicht subtrahiren?
Vielen Dank für eure Antwort!