Build a Weather App

Hey guys, I added an event listener to switch the temperature from F to C, but I don’t know how to toggle back and forth with it…Advice needed please…

Hello there,

You have a few options to do this:

  1. Create a boolean variable (scope greater than the eventListener function), use this boolean to determine if you should display and calculate C or F.
  2. Inside the eventListener function, make a query to find out if temperatureDegree is displaying in C or F, then use logic to perform the appropriate calculation and reset the innerHTML.

Hope this helps

Thanks a lot, this helped me figure it out :grin: