function renderSearchHistory() {
  var storedInitials = JSON.parse(localStorage.getItem("search"));
  locationArr = storedInitials;

  for (var i = 0; i < locationArr.length; i++) {
    var searchHistoryList = document.createElement("li");
    searchHistoryList.setAttribute("class", "list-group-item");
    searchHistoryList.textContent = locationArr[i];
    locationEl.append(searchHistory);
  }
  searchHistory.append(searchHistoryList);
}
//Function to display the list of search history accessing it from localStorage.
Function to display the list of search history accessing it from localStorage.
Function to display the list of search history accessing it from localStorage .
function renderSearchHistory() {
  var storedInitials = JSON.parse(localStorage.getItem("search"));
  locationArr = storedInitials;
  for (var i = 0; i < locationArr.length; i++) {
    var searchHistoryList = document.createElement("li");
    searchHistoryList.setAttribute("class", "list-group-item");
    searchHistoryList.textContent = locationArr[i];
    locationEl.append(searchHistory);
  }
  searchHistory.append(searchHistoryList);
}
function renderSearchHistory ( ) { var storedInitials = JSON . parse ( localStorage . getItem ( "search" ) ) ; locationArr = storedInitials ; for ( var i = 0 ; i < locationArr . length ; i ++ ) { var searchHistoryList = document . createElement ( "li" ) ; searchHistoryList . setAttribute ( "class" , "list-group-item" ) ; searchHistoryList . textContent = locationArr [ i ] ; locationEl . append ( searchHistory ) ; } searchHistory . append ( searchHistoryList ) ; }
Function to display the list of search history accessing it from localStorage.
Function to display the list of search history accessing it from localStorage .