A weather dashboard with a 5 day forecast that will run in the browser and feature dynamically updated HTML and CSS.
Live
https://malloryfaria.github.io/weather-dashboard/
Built with
- HTML
- JavaScript
- JQuery
- BootStrap
- OpenWeather API
- Axios
// Listener for the click on the search button
$(search).on("click",function() {
var searchTerm = input.value;
// Ensure user input a city name
if (searchTerm) {
getWeather(searchTerm);
searchHistory.push(searchTerm);
localStorage.setItem("search",JSON.stringify(searchHistory));
loadSearchHistory();
}
// If user didn't input a value, alert them
else {
alert("Please enter a city name");
}
$("#city-input").val("");
})
None
© Mallory