function clickButton(event) {
    console.log("hello world");
    event.preventDefault();
    var cityKey = "NameInput" + inputCity,
      inputCity;
    var inputCity = $("#searchInput").val().trim();
    console.log(inputCity);

    search(inputCity);

    function search(inputCity) {
      searchCity(inputCity);
      // console.log(inputCity);
      localStorage.setItem("NameInput" + inputCity, inputCity);
      var newButton = $("<button>")
        .text(inputCity)
        .attr("id", inputCity)
        .addClass("listDkb btn btn-light btn-outline-dark")
        .on("click", function () {
          search(inputCity);
        });
      $("#" + cityKey).val(localStorage.getItem(cityKey));
      newButton.val(localStorage.getItem(cityKey));
      $("#cityList").after(newButton);
    }
  }
// Function adjusted to add historic selections and make them clickable for a new search.
Function adjusted to add historic selections and make them clickable for a new search.
Function adjusted to add historic selections and make them clickable for a new search .
function clickButton(event) {
    console.log("hello world");
    event.preventDefault();
    var cityKey = "NameInput" + inputCity,
      inputCity;
    var inputCity = $("#searchInput").val().trim();
    console.log(inputCity);
    search(inputCity);
    function search(inputCity) {
      searchCity(inputCity);
      localStorage.setItem("NameInput" + inputCity, inputCity);
      var newButton = $("<button>")
        .text(inputCity)
        .attr("id", inputCity)
        .addClass("listDkb btn btn-light btn-outline-dark")
        .on("click", function () {
          search(inputCity);
        });
      $("#" + cityKey).val(localStorage.getItem(cityKey));
      newButton.val(localStorage.getItem(cityKey));
      $("#cityList").after(newButton);
    }
  }
function clickButton ( event ) { console . log ( "hello world" ) ; event . preventDefault ( ) ; var cityKey = "NameInput" + inputCity , inputCity ; var inputCity = $ ( "#searchInput" ) . val ( ) . trim ( ) ; console . log ( inputCity ) ; search ( inputCity ) ; function search ( inputCity ) { searchCity ( inputCity ) ; localStorage . setItem ( "NameInput" + inputCity , inputCity ) ; var newButton = $ ( "<button>" ) . text ( inputCity ) . attr ( "id" , inputCity ) . addClass ( "listDkb btn btn-light btn-outline-dark" ) . on ( "click" , function ( ) { search ( inputCity ) ; } ) ; $ ( "#" + cityKey ) . val ( localStorage . getItem ( cityKey ) ) ; newButton . val ( localStorage . getItem ( cityKey ) ) ; $ ( "#cityList" ) . after ( newButton ) ; } }
Function adjusted to add historic selections and make them clickable for a new search.
Function adjusted to add historic selections and make them clickable for a new search .
// console.log(inputCity);