Skip to content
Advertisement

I need to convert Celsius to Fahrenheit, but I keep receiving NaN as an answer

As stated above I need this to convert temperatures and show the respective picture but all I get now is NaN for the resulting conversion.

I have been trying to fix it but can’t seem to find the issue.

Can someone please help?

JavaScript

Any help would be greatly appreciated!

Advertisement

Answer

cInput and fInput are domelements (tags) but, at

JavaScript

they are used as variables, you need to use cInput.value|fInput.value / use some variable and then assign it wherever you want.

Hope it will rectify yours.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement