Adding toggle switch

Adding toggle switch
0.0 0


How to add toggle switch in this?


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:


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;}
{ do other thing; }