<body>
<script>
Var colors=[' red ', 'blue', 'yellow'].//here only put three colors, assuming that the actual colors with thousands of colors in
Var len=colors. Length;
The function the text () {
For (var I=0, I & lt; Len. I++) {
Document. The getElementById (' id1). Style, color=colors [I];
}
}
</script>
<script>
Var colors=[' red ', 'blue', 'yellow'].//here only put three colors, assuming that the actual colors with thousands of colors in
Var len=colors. Length;
The function the text () {
For (var I=0, I & lt; Len. I++) {
Document. The getElementById (' id1). Style, color=colors [I];
}
}
</script>