Local Weather Project Help

I can’t make my temperature to switch between celsius and fahrenheit constantly. It does change when I click on it for the first time but then nothing.
There is the change button and a paragraph tag which shows the sentence.

var switchTemp = true;
$(".change").on(“click”, function(){
if (switchTemp === false){
$("#temp").html(“The current temperature is: " + far + " “);
switchTemp = true;
$(”#temp”).html("The current temperature is: " + celsius + " ");
switchTemp = false;

The problem is somewhere else. Post the whole code.

I tried you snippet and it works fine:

there it is

Problem is with slider.

Replace “click” with “change” and set switchTemp initial value to false.

var switchTemp = false;
  $(".change").on("change", function(){

Thank you very much!