P
passion_to_be_free
So I have a table setup like this:
<table>
<tr>
<td>425</td>
</tr>
</table>
and I'm retrieving a value out of a table using this code:
var x=document.getElementById('myTable').rows
var y=x[0].cells
var usedMin = y[0].innerHTML;
now, I know that usedMin is a number, when I call:
return usedMin
I get "425". (the number I expect to get.) But for some reason, if I
try to do any math on it, like:
usedMin - 100
parseInt(usedMin)
I get the NaN error. Does anyone know why I can't type cast this as an
integer?
-benjamin
<table>
<tr>
<td>425</td>
</tr>
</table>
and I'm retrieving a value out of a table using this code:
var x=document.getElementById('myTable').rows
var y=x[0].cells
var usedMin = y[0].innerHTML;
now, I know that usedMin is a number, when I call:
return usedMin
I get "425". (the number I expect to get.) But for some reason, if I
try to do any math on it, like:
usedMin - 100
parseInt(usedMin)
I get the NaN error. Does anyone know why I can't type cast this as an
integer?
-benjamin