This should be a simple issue, I can't make it work however. The code takes a sentence line_2 and animates each letter line_2[i], I want to add a color to each letter. I added a variable heya and used a selector as shown in the code but its not working. Im probably something simple.
Here is the code:
for (i = line_2.length - 1; i >= 0; i--) {
$('<div>', {
var heya = "line2" + i;
html: '<br><br><br><br>' + '<div id= ' + heya + '>' + line_2[i] + '</div>'
})
$("#" + heya).css("color", "blue");
.addClass('letter')
.appendTo(elements);
}
$('<div>', { .... })code. That looks pretty wrong too.