I have a couple of divs that show colors. When I click on a div, it is not showing the right color. It shows only the last color #000000
var color = ["#003366", "#336699", "#3366CC", "#003399", "#000099", "#0000CC", "#666666", "#333333", "#000000"];
var i = 0;
for (; color[i];) {
    var theme = "#theme" + i;
    var text = color[i];
    $(theme).click(function() {
        $("#title_content").css('background-image', '');
        $("#content_text").css('background-image', '');
        $("#title_content").css('background-color', text);
        $("#content_text").css('background-color', text);
    });
    i++;
}
 
     
    