Help with show local weather project

Why is the click event firing twice? Because of this the switch to change unit doesn’t work.Spent a lot of time to fix it but failed.Can someone help?
Show local weather

You need to use on(‘change’) instead on.click for inputs type switch

1 Like

Didn’t know that . Fixed it now. Thanks for the help .

Would really like to know what happens behind the scene if I use click event for a switch. What causes the click to fire twice and not more than that?