Trying to get JQuery to toggle

Javascript line 316 and onwards… What am I doing wrong here? :disappointed_relieved:

Sorry! I’m trying to toggle between fahrenheit and celsius. It’s going good from C to F but then back to C doesn’t happen for some reason. I’ve been trying a lot of solutions and kind of getting frustrated by it to be honest :face_with_hand_over_mouth:

Hi, @J_RO please share your coding from editor. or share your image screenshot where you face problem. Happy Coding

Thank you! I didn’t even notice the equal sign missing.

Also learned something new about the div causing the function to cause twice. Can you tell me how you ‘debugged’ this? I didn’t see anything useful in the console which could have pointed me in the right direction.

Hi,Tariqul
I have just finished the pen. Here is my link https://codepen.io/Alimama/pen/bLZdZM, have a look, hopefully my code colud help you solve your problem.

You are right, but I can not see any code there to help with, I would like to help and wish I was as experienced as you are.:sweat_smile:

Labels are clickable too!
html label

When a <label> is clicked or tapped, and it is associated with a form control, the resulting click event is also raised for the associated control.

… so you get 2 clicks :stuck_out_tongue:

1 Like

Your comment really helped, thank you!

This JSFiddle showcases it by adding a counter. When you click the checkbox it adds only 1. When you click on the ‘click here’ label it registers as 2 clicks.
http://jsfiddle.net/vgWGT/15/

I didn’t use the label as the target for the click event but the switch it’s wrapping div so I’m still kind of confused but I guess I should just move on :face_with_hand_over_mouth:

In case @camperextraordinaire his reply wasn’t clear enough for you:

Keep it up! Eventually you and me, we’ll be as experienced as him and many others :slight_smile:

Thank you and I hope so.:smile: