Adding toggle switch

Adding toggle switch
0.0 0

#1


How to add toggle switch in this?


#2

There are quite a few different ways of doing it. What I did was to use the .on(“click”)-function to change the CSS, so that when you clicked the button it removed the Celsius box and instead showed the Fahrenheit box. You can see it here:


#3

a basic toggle would be something like…

var tog = 0;
function changeTemp() {
 if(tog = !tog) // if true or 1... ( this changes between true and false every click )
{ do something;}
else
{ do other thing; }
}