https://omg10.com/4/10644249

 

 

🌦️ Free Online Weather Checker


async function getWeather() { const city = document.getElementById('cityInput').value; if (!city) { alert('Please enter a city name'); return; }

const url = `https://api.openweathermap.org/data/2.5/weather?q=${city}&appid=${apiKey}&units=metric`;

try { const res = await fetch(url); const data = await res.json();

if (data.cod === 200) { document.getElementById('result').innerHTML = `

${data.name}, ${data.sys.country}

Temperature: ${data.main.temp} °C

Weather: ${data.weather[0].description}

Humidity: ${data.main.humidity}%

Wind: ${data.wind.speed} km/h

`; } else { document.getElementById('result').innerHTML = `

City not found

`; } } catch (error) { document.getElementById('result').innerHTML = `

Error fetching data

`; } }

 

Categories: DAILYSEARCH

@dailysearch

Hi, I'm M. SAIF, the founder and author behind dailysearch.blog—your trusted source for trending insights, business guides, AI innovations, and more. With a passion for digital growth and real-world impact, I’ve built DailySearch to empower entrepreneurs, learners, and readers across the globe. Every article I publish is carefully researched, SEO-optimized, and designed to deliver real value. 👉 You can trust me to bring you facts, clarity, and the latest trends—all in one place. Let’s grow and explore the future, together.

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *