// Select the element with class "output"
var outputElement = document.getElementsByClassName("output").item(0);

// Select the ul tag under the div
var mainList = outputElement.querySelector("ul");
// Update the ID
mainList.id = "mainList";

// Get the list of divs and store as an array
var divs = Array.from(document.getElementsByTagName('div'));

// Get the list of tagNames from the list of divs and store as an array
var tagNames = Array.from(divs, element => element.tagName.toLowerCase())
// Output the tagNames array
console.log(tagNames);

// Loop through all of the child elements under the "output" div
// For the record, the instructions for this activity are complete trash and 
// this is my best guess as to how it's meant to be done
for (let i = 0; i < outputElement.children.length; i++) {

    // If there are divs left to be given an ID, give it an ID equaling 
    // "id" + a numerical counter value
    if (i < divs.length) {

        divs[i].id = String("id" + i);

    }

    // If i is divisible by 2
    if (i % 2 == 0) {

        // Set the child element to "red" color
        outputElement.children.item(i).style.color = "red";

        // Otherwise
    } else {

        // Set the child element to "blue" color
        outputElement.children.item(i).style.color = "blue";

    }

}