assets/js/script.js
// A function to call when the city item in the search history is clicked by the user
A function to call when the city item in the search history is clicked by the user
A function to call when the city item in the search history is clicked by the user
function searchWithHistory(event) {
    event.preventDefault();
    searchValue = this.getAttribute('data-search-history');
    searchInput.value = searchHistoryArray[searchValue];
    getWeatherApi(event);
    document.body.scrollTop = 0;
    document.documentElement.scrollTop = 0;
}
function searchWithHistory ( event ) { event . preventDefault ( ) ; searchValue = this . getAttribute ( 'data-search-history' ) ; searchInput . value = searchHistoryArray [ searchValue ] ; getWeatherApi ( event ) ; document . body . scrollTop = 0 ; document . documentElement . scrollTop = 0 ; }
A function to call when the city item in the search history is clicked by the user
A function to call when the city item in the search history is clicked by the user