\n
\n 10 \n 5 \n
\n ')}),t+="",e.innerHTML=t,console.log(t)}function a(e){document.querySelector("#city").innerHTML=e.data.name,document.querySelector("#temperature").innerHTML=Math.round(e.data.main.temp),document.querySelector("#humidity").innerHTML=e.data.main.humidity,document.querySelector("#wind").innerHTML=Math.round(e.data.wind.speed),document.querySelector("#description").innerHTML=e.data.weather[0].main}function n(e){var t="https://api.openweathermap.org/data/2.5/weather?q=".concat(e,"&appid=").concat("5f472b7acba333cd8a035ea85a0d4d4c","&units=metric");axios.get(t).then(a)}function r(e){e.preventDefault(),n(document.querySelector("#city-input").value)}function c(e){var t="https://api.openweathermap.org/data/2.5/weather?lat=".concat(e.coords.latitude,"&lon=").concat(e.coords.longitude,"&appid=").concat("5f472b7acba333cd8a035ea85a0d4d4c","&units=metric");axios.get(t).then(a)}function o(e){e.preventDefault(),navigator.geolocation.getCurrentPosition(c)}var i=document.querySelector("#search-form");i.addEventListener("submit",r);var d=document.querySelector("#current-location-button");d.addEventListener("click",o),n("New York"),t(); Open-source code by Liana Hirol