all.
I am trying to create an array where I can change the color of the fonts within them.
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Array Font Colors</title>
</head>
<body>
<script type="application/javascript">
var colors= new Array("Black", "White", "Yellow");
for(var a=0; a<colors.length; a++){
document.write(colors[a]+ "<br>");
}
</script>
</body>
</html>
The above is what I have that makes the array, and displays it. I am not sure how to change the color of each element however to its given array value. For example, since the second array element value is White, make the font color white. I am new to JavaScript and am a bit confused on how this is done.
Thank you