Change background according to the temperature[HELP]


I tried to use ‘’ if ‘’ to change the background but for some reason it is not working out, someone could help me please?

Do you realize you have the same background image in your CSS as the one you specify in your if statement block? Plus, you are only changing the background when a button is clicked? Also, since your celsius variable is a string (i.e. “11 °C”), it will never be greater than 10 (your if statement condition).

1 Like

Oh, I think the problem is celsius being a string, I will try to figure that out


Your condition fails if celsius === 0 || celsius === 20.

1 Like