JavaScript help?

Status
Not open for further replies.

Logic

Bobby Billionaire
Feb 8, 2012
748
207
I'm working with a js file & I am needing help changing the colors within it. I'm unfamiliar with js, never worked with it. Displayed below is my code, I need to know what I edit to change the different colors.

Code:
function rain()
{
var aspans = document.getElementsByTagName('span');
for (var i = 0; i < aspans.length; i++)
{
if (aspans[i].className =='rainbow')
{
var words=aspans[i].innerHTML;
var spacer="";
var rainText="";
//var colourscheme=new Array("0","1","6","7","8","9","D","E","F")
var colourscheme=new Array("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F")
for(var ch=0;ch<=(words.length-1);ch++){
var c1=Math.round(Math.random()*(colourscheme.length-1));
var c2=Math.round(Math.random()*(colourscheme.length-1));
var c3=Math.round(Math.random()*(colourscheme.length-1));
var c4=Math.round(Math.random()*(colourscheme.length-1));
var c5=Math.round(Math.random()*(colourscheme.length-1));
var c6=Math.round(Math.random()*(colourscheme.length-1));
rainText+="<strong><font color=\"#"+colourscheme[c1]+colourscheme[c2]+colourscheme[c3]+colourscheme[c4]+colourscheme[c5]+colourscheme[c6]+"\">"+words[ch]+"</font></strong>";
}
aspans[i].innerHTML=rainText;
}
}
}
 
Status
Not open for further replies.

Users who are viewing this thread

Top