Having trouble with conversion buttons on local weather app [Solved]

My conversion buttons on my local weather app are not working correctly. It switches from celsius to fahrenheit but it won’t switch back. Here is my pen http://codepen.io/johnwm211/pen/JKLNKw

You have a typo in this area:

// you intended to refer to `.celsius-button`!
$(".celcius-button").on('click', function(e){
1 Like

Also, I believe you have a conversion error from Fahrenheit to Celsius. I get 65°C for 83°F!

This is your code:

var cTemp = Math.floor((temp) - 32 * 5/9) + '&deg' + 'C';

The - 32 should be inside the parentheses with temp, like (temp - 32) * 5/9, so now I have 28°C for 83°F.

I can’t believe I missed that! Thanks a lot @kevcomedia!