'I can't select element backgroundColor in for statement

How can I to delete div image and select the div.backgroundColor :)

for (let i = 0; i < color1.length; i++) {
    color1[i].addEventListener('click', function (event) {  
        color1[i].style.backgroundImage = "none";
        let colorItem = color1[i].style.backgroundColor;
        console.log(some)

        if (colorItem == "red") {
            console.log("yes")
        }
        else {
            console.log("no")
        }
        event.preventDefault();
    });
}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source