Talk:Adding Two Numbers - JS: Difference between revisions
Jump to navigation
Jump to search
isNaN not working |
No edit summary |
||
Line 1: | Line 1: | ||
The error checking code is not working | The error checking code is not working. I tried copying the code in the tutorial but that didn't work either. If I typed in one number and nothing in the other box, I simply got NaN in the Total box, but no alert. | ||
I changed the code to assign numbers to FirstNumber and SecondNumber variables, then did the isNaN on those variables instead. That worked fine. | |||
Thanks | Thanks | ||
Andy |
Latest revision as of 11:37, 15 September 2015
The error checking code is not working. I tried copying the code in the tutorial but that didn't work either. If I typed in one number and nothing in the other box, I simply got NaN in the Total box, but no alert.
I changed the code to assign numbers to FirstNumber and SecondNumber variables, then did the isNaN on those variables instead. That worked fine.
Thanks Andy