I am confused as to why the “click” jQuery method in my “Show the local weather” app only works with the first click?
Please see my Codepen example here:
If you click the button, it works fine the first time. I set a variable to “isCelsius” as a boolean to control the path of the if statement. If they convert to Fahrenheit, it is set to “false” so next time the button is clicked it should use the path of the if statement to change it back to Celsius.
But it looks like the click method only works on the first click and never again. Can anyone please explain why this is the case?