You could just make the click handler async in this case.
submitButton.addEventListener('click',async()=>{infoBox.style.display='grid';infoBox.innerText=awaitcallOpenWeather(`http://api.openweathermap.org/data/2.5/weather?q=${inputValue.value}&APPID=${apiKey}`);// Use an api key of openweather api instead of ${apiKey} to make this code work.infoBox.style.boxShadow='0 0 2px 0 #d3d3d3';});
You could just make the click handler async in this case.
TIL! That makes the code a little more clean. Let me make the change right away. Thanks @miketalbot !