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;
}else{
$(”#temp”).html("The current temperature is: " + celsius + " ");
switchTemp = false;
}
});