-
Notifications
You must be signed in to change notification settings - Fork 0
/
play.js
29 lines (20 loc) · 998 Bytes
/
play.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
`use strict`
const container = document.querySelector('.container');
const search = document.querySelector('.search_box button');
const weatherBox = document.querySelector('.weather_box');
const weatherDetails = document.querySelector('.weather_details');
const image = document.querySelector('.weather_box img');
const temperature = document.querySelector('.temprature');
const describtion = document.querySelector('.weather_box .describtion');
const humidity = document.querySelector(' .humidity');
const wind = document.querySelector('.wind');
const APIkey = '8b50bb88133ad6fda215d17d779ea295'
const apiUrl = `https://api.openweathermap.org/data/2.5/weather?units=metric&q=nigeria`;
async function checkWeather() {
const response = await fetch(apiUrl + `&appid=${APIkey}`);
let data = await response.json();
console.log(data)
// temperature.innerHTML = Math.round(data.main.temp) ;
humidity.innerHTML = data.main.humidity;
wind.innerHTML = data.main.speed;
}