function returnForecast(cityName) {
    let queryURL = `https://api.openweathermap.org/data/2.5/forecast?q=${cityName}&units=imperial&APPID=6c0ac38b22e3e819b50460a5a899f855`;

    $.get(queryURL).then(function (response) {
        let forecastInfo = response.list;
        console.log(response);
        forecastDiv.empty();
        $.each(forecastInfo, function (i) {
            if (!forecastInfo[i].dt_txt.includes("12:00:00")) {
                return;
            }
            //Forecast Dates
            let forecastDate = new Date(forecastInfo[i].dt * 1000);
            //displays icon
            let weatherIcon = `https://openweathermap.org/img/wn/${forecastInfo[i].weather[0].icon}.png`;
            // append data to div when searched
            forecastDiv.append(`
                <div class="card text-white bg-primary">
                    <div class="card-body">
                        <h6>${forecastDate.getMonth() + 1}/${forecastDate.getDate()}/${forecastDate.getFullYear()}</h6>
                        <img src=${weatherIcon} alt="Icon">
                        <p>Temp: ${forecastInfo[i].main.temp}&#176;F</p>
                        <p>Humidity: ${forecastInfo[i].main.humidity}%</p>
                    </div>
                </div>
            </div>
            `)
        })
    })
}
// API call for the 5 day forecast
API call for the 5 day forecast
API call for the 5 day forecast
function returnForecast(cityName) {
    let queryURL = `https://api.openweathermap.org/data/2.5/forecast?q=${cityName}&units=imperial&APPID=6c0ac38b22e3e819b50460a5a899f855`;
    $.get(queryURL).then(function (response) {
        let forecastInfo = response.list;
        console.log(response);
        forecastDiv.empty();
        $.each(forecastInfo, function (i) {
            if (!forecastInfo[i].dt_txt.includes("12:00:00")) {
                return;
            }
            let forecastDate = new Date(forecastInfo[i].dt * 1000);
            let weatherIcon = `https://openweathermap.org/img/wn/${forecastInfo[i].weather[0].icon}.png`;
            forecastDiv.append(`
                <div class="card text-white bg-primary">
                    <div class="card-body">
                        <h6>${forecastDate.getMonth() + 1}/${forecastDate.getDate()}/${forecastDate.getFullYear()}</h6>
                        <img src=${weatherIcon} alt="Icon">
                        <p>Temp: ${forecastInfo[i].main.temp}&#176;F</p>
                        <p>Humidity: ${forecastInfo[i].main.humidity}%</p>
                    </div>
                </div>
            </div>
            `)
        })
    })
}
function returnForecast ( cityName ) { let queryURL = ` ${ cityName } ` ; $ . get ( queryURL ) . then ( function ( response ) { let forecastInfo = response . list ; console . log ( response ) ; forecastDiv . empty ( ) ; $ . each ( forecastInfo , function ( i ) { if ( ! forecastInfo [ i ] . dt_txt . includes ( "12:00:00" ) ) { return ; } let forecastDate = new Date ( forecastInfo [ i ] . dt * 1000 ) ; let weatherIcon = ` ${ forecastInfo [ i ] . weather [ 0 ] . icon } ` ; forecastDiv . append ( ` ${ forecastDate . getMonth ( ) + 1 } ${ forecastDate . getDate ( ) } ${ forecastDate . getFullYear ( ) } ${ weatherIcon } ${ forecastInfo [ i ] . main . temp } ${ forecastInfo [ i ] . main . humidity } ` ) } ) } ) }
API call for the 5 day forecast
API call for the 5 day forecast
//Forecast Dates //displays icon // append data to div when searched