function displayData(cityObj) {
    console.log(cityObj);

    if (localStorage.length > 0) {
        $("#curentDay").removeClass("hide");

        // //get image data which has img-url, img-name and img-descr
        var setName = cityObj.name;
        var easyGet = cityObj.data.current;
        var setImage = easyGet.weather[0].icon;
        var iconUrl = "https://openweathermap.org/img/w/" + setImage + ".png";
        console.log(setImage);
        showWeatherDiv.innerHTML = '';

        var date = " (" + moment().format('L') + ")";
        $('#curentDay').append(
            $('<div/>')
                .attr("id", "mainDay")
                .addClass("border border-2 border-dark p-2")
                .append(
                    $('<h2/>')
                        .text(setName + date)
                        .addClass("fw-bolder")
                        .append(
                            $('<img/>')
                                .attr("src", iconUrl)
                        ),
                    $('<h5/>')
                        .text("Temp: " + easyGet.temp + " °F"),
                    $('<h5/>')
                        .text("Wind: " + easyGet.wind_speed + " MPH"),
                    $('<h5/>')
                        .text("Humidity: " + easyGet.humidity + " %"),
                    $('<h5/>')
                        .text("UV Index: ")
                        .append(
                            $('<span/>')
                                .text(easyGet.uvi)
                                .attr("id", "UV")
                        )
                )
        );

        if (easyGet.uvi < 3) {
            $('#UV')
                .addClass("uv-low")
        } else if (todayUV > 5) {
            $('#UV')
                .addClass("uv-high")
        } else {
            $('#UV')
                .addClass("uv-mid")
        }
    }
    $('#curentDay').append(
        $('<div/>')
            .attr("id", "forecast")
            .text("5-Day Forecast")
            .append(
                $('<div/>')
                    .attr("id", "row")
                    .addClass("row")
            )
    )
    var daily = cityObj.data.daily;
    console.log(daily);
    //fill up 5 day forecast
    for (let i = 1; i < 6; i++) {
        //date
        var nextDay = moment().add((i), 'days').format("L");
        //get icon code and url
        var icon = daily[i].weather[0].icon
        iconUrl = "https://openweathermap.org/img/w/" + icon + ".png";
        //create and append ul, and li items
        $('#row').append(
            $('<ul/>')
                .addClass("col-2")
                .append(
                    $('<li/>')
                        .text(nextDay),
                    $('<li/>')
                        .append(
                            $('<img/>')

                                .attr("src", iconUrl)
                        ),
                    $('<li/>')
                        .text("Temp: " + daily[i].temp.day + " °F"),
                    $('<li/>')
                        .text("Wind: " + daily[i].wind_speed + "MPH"),
                    $('<li/>')
                        .text("Humidity: " + daily[i].humidity + " %"),
                )
        )
    }
}
//create elements and append them to right side of display
create elements and append them to right side of display
create elements and append them to right side of display
function displayData(cityObj) {
    console.log(cityObj);
    if (localStorage.length > 0) {
        $("#curentDay").removeClass("hide");
        var setName = cityObj.name;
        var easyGet = cityObj.data.current;
        var setImage = easyGet.weather[0].icon;
        var iconUrl = "https://openweathermap.org/img/w/" + setImage + ".png";
        console.log(setImage);
        showWeatherDiv.innerHTML = '';
        var date = " (" + moment().format('L') + ")";
        $('#curentDay').append(
            $('<div/>')
                .attr("id", "mainDay")
                .addClass("border border-2 border-dark p-2")
                .append(
                    $('<h2/>')
                        .text(setName + date)
                        .addClass("fw-bolder")
                        .append(
                            $('<img/>')
                                .attr("src", iconUrl)
                        ),
                    $('<h5/>')
                        .text("Temp: " + easyGet.temp + " °F"),
                    $('<h5/>')
                        .text("Wind: " + easyGet.wind_speed + " MPH"),
                    $('<h5/>')
                        .text("Humidity: " + easyGet.humidity + " %"),
                    $('<h5/>')
                        .text("UV Index: ")
                        .append(
                            $('<span/>')
                                .text(easyGet.uvi)
                                .attr("id", "UV")
                        )
                )
        );
        if (easyGet.uvi < 3) {
            $('#UV')
                .addClass("uv-low")
        } else if (todayUV > 5) {
            $('#UV')
                .addClass("uv-high")
        } else {
            $('#UV')
                .addClass("uv-mid")
        }
    }
    $('#curentDay').append(
        $('<div/>')
            .attr("id", "forecast")
            .text("5-Day Forecast")
            .append(
                $('<div/>')
                    .attr("id", "row")
                    .addClass("row")
            )
    )
    var daily = cityObj.data.daily;
    console.log(daily);
    for (let i = 1; i < 6; i++) {
        var nextDay = moment().add((i), 'days').format("L");
        var icon = daily[i].weather[0].icon
        iconUrl = "https://openweathermap.org/img/w/" + icon + ".png";
        $('#row').append(
            $('<ul/>')
                .addClass("col-2")
                .append(
                    $('<li/>')
                        .text(nextDay),
                    $('<li/>')
                        .append(
                            $('<img/>')
                                .attr("src", iconUrl)
                        ),
                    $('<li/>')
                        .text("Temp: " + daily[i].temp.day + " °F"),
                    $('<li/>')
                        .text("Wind: " + daily[i].wind_speed + "MPH"),
                    $('<li/>')
                        .text("Humidity: " + daily[i].humidity + " %"),
                )
        )
    }
}
function displayData ( cityObj ) { console . log ( cityObj ) ; if ( localStorage . length > 0 ) { $ ( "#curentDay" ) . removeClass ( "hide" ) ; var setName = cityObj . name ; var easyGet = cityObj . data . current ; var setImage = easyGet . weather [ 0 ] . icon ; var iconUrl = "https://openweathermap.org/img/w/" + setImage + ".png" ; console . log ( setImage ) ; showWeatherDiv . innerHTML = '' ; var date = " (" + moment ( ) . format ( 'L' ) + ")" ; $ ( '#curentDay' ) . append ( $ ( '<div/>' ) . attr ( "id" , "mainDay" ) . addClass ( "border border-2 border-dark p-2" ) . append ( $ ( '<h2/>' ) . text ( setName + date ) . addClass ( "fw-bolder" ) . append ( $ ( '<img/>' ) . attr ( "src" , iconUrl ) ) , $ ( '<h5/>' ) . text ( "Temp: " + easyGet . temp + " °F") , $ ( '<h5/>' ) . text ( "Wind: " + easyGet . wind_speed + " MPH" ) , $ ( '<h5/>' ) . text ( "Humidity: " + easyGet . humidity + " %" ) , $ ( '<h5/>' ) . text ( "UV Index: " ) . append ( $ ( '<span/>' ) . text ( easyGet . uvi ) . attr ( "id" , "UV" ) ) ) ) ; if ( easyGet . uvi < 3 ) { $ ( '#UV' ) . addClass ( "uv-low" ) } else if ( todayUV > 5 ) { $ ( '#UV' ) . addClass ( "uv-high" ) } else { $ ( '#UV' ) . addClass ( "uv-mid" ) } } $ ( '#curentDay' ) . append ( $ ( '<div/>' ) . attr ( "id" , "forecast" ) . text ( "5-Day Forecast" ) . append ( $ ( '<div/>' ) . attr ( "id" , "row" ) . addClass ( "row" ) ) ) var daily = cityObj . data . daily ; console . log ( daily ) ; for ( let i = 1 ; i < 6 ; i ++ ) { var nextDay = moment ( ) . add ( ( i ) , 'days' ) . format ( "L" ) ; var icon = daily [ i ] . weather [ 0 ] . icon iconUrl = "https://openweathermap.org/img/w/" + icon + ".png" ; $ ( '#row' ) . append ( $ ( '<ul/>' ) . addClass ( "col-2" ) . append ( $ ( '<li/>' ) . text ( nextDay ) , $ ( '<li/>' ) . append ( $ ( '<img/>' ) . attr ( "src" , iconUrl ) ) , $ ( '<li/>' ) . text ( "Temp: " + daily [ i ] . temp . day + " °F") , $ ( '<li/>' ) . text ( "Wind: " + daily [ i ] . wind_speed + "MPH" ) , $ ( '<li/>' ) . text ( "Humidity: " + daily [ i ] . humidity + " %" ) , ) ) } }
create elements and append them to right side of display
create elements and append them to right side of display
// //get image data which has img-url, img-name and img-descr //fill up 5 day forecast //date //get icon code and url //create and append ul, and li items