Removing old error message from Web App under the course "Integrating external APIs"

The course under HubSpot Academy “Integrating external APIs”

The lesson video under “Explore more advanced APIs techniques”

I am not able to clear out the old error message for my web app whenever I type a new query based on the following instructions given in the last part of the video for my web app

The last thing you’ll want to do is make sure that the message clears once the user types in another query. You can see that here if you now type in a new city, the old error message doesn’t go away. Go back to your “getWeather()” function, and before your AJAX call, you can write some code to clear out whatever has been written in the HTML’s divs. Copy your code from further down in this function, and instead of setting each div equal to a specific value, set them equal to nothing—or an empty string instead.

This is the exact code to be typed in but it does not do anything at all.

$(“.city”).text(“”);

$(“.temp”).text(“”);

Could someone help with this. Is there any problem with my code?

function getWeather(searchQuery){

var url = “https://api.openweathermap.org/data/2.5/weather?q=“+searchQuery+”&units=metric&appid=”+apiKey;

$(“.city”).text(“”);

$(“.temp”).text(“”);

$.ajax(url,{success: function(data){

$(“.city”).text(data.name);

$(“.temp”).text(data.main.temp);

}, error: function(error){

$(“.error-message”).text(“An error occured”);

}})

}

function searchWeather(){

var searchQuery = $(“.search”).val();

getWeather(searchQuery);

}