I\'m trying to alternate the colors of every letter in a specific div on my webpage using javascript.
I found this script on a forum that alternates the color of the wor
Replace this:
var text = HTML.split(' '), output = ''; for (var w=0; w' + text[w] + ' '; }
With this:
for (var c=0; c' + HTML.CharAt(c) + ' '; }
The output's going to be pretty verbose. If you want to skip spaces, you'll need to add a little logic for that.