Currently I’m working on the local weather app challenge, and i got some problem here with the button to switch between Fahrenheit and celcius. Here is my codepen, i wonder what’s wrong with the code because the button is not switching celcius into Fahrenheit.
Thank you.
Codepen link
There are a few things that may contribute to your issues:
- There were curly braces missing from your if/else condition.
- The icon, temp and other variables are defined in the getJSON block and are thus not accessible outside of that block.
yea the curly braces did missing… my fault… but i guess i found that ° that created the trouble…