Javascript; converting string to number
I want to change the forecolor of my temperature display according to outside temp.
The original value of the temp ia a string, e.g "15,4" (checked with typeOf)
I used the replace function to change the comma to a decimal "15.4"
Whatever I try, I can't get the string to be a number
If I use
document.getElementById("outtemp").value; - it gives me Undefined
document.getElementById("outtemp").innerHTML; - it gives me string value
parseInt, parseFloat and multiplying by 1 keeps on NaN-ning me.
How to get an integer value out of string value?
t.i.a.
|
__________________
-----------------------------------------------------
If debugging is the art of removing bugs, then
programming must be the art of inserting them.
I do comply with Flyguy's signature (If he still had one)
|