Help with show local weather project

Help with show local weather project
0.0 0

#1

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


#2

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


#3

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


#4

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?